22111 lines
744 KiB
VB.net
22111 lines
744 KiB
VB.net
'' ------------------------------------------------------------------------------
|
|
'' <auto-generated>
|
|
'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com
|
|
'' {"TargetFramework":"Net48","NameSpace":"MicCustImportMessage","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{},"JsonOutput":{},"Enabled":true},"Miscellaneous":{}}
|
|
'' </auto-generated>
|
|
'' ------------------------------------------------------------------------------
|
|
#Disable Warning
|
|
Imports System
|
|
Imports System.Diagnostics
|
|
Imports System.Xml.Serialization
|
|
Imports System.Runtime.Serialization
|
|
Imports System.Collections
|
|
Imports System.Xml.Schema
|
|
Imports System.ComponentModel
|
|
Imports System.Xml
|
|
Imports System.IO
|
|
Imports System.Text
|
|
Imports System.Collections.Generic
|
|
|
|
Namespace MicCustImportMessage
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType(AnonymousType:=True, [Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0"),
|
|
XmlRoot([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0", IsNullable:=False)>
|
|
Partial Public Class MicCustImportInvoiceComponent
|
|
|
|
#Region "Private fields"
|
|
Private _invoice As List(Of TMicInvoice)
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._invoice = New List(Of TMicInvoice)()
|
|
End Sub
|
|
|
|
<XmlElement("Invoice")>
|
|
Public Property Invoice() As List(Of TMicInvoice)
|
|
Get
|
|
Return Me._invoice
|
|
End Get
|
|
Set
|
|
Me._invoice = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(MicCustImportInvoiceComponent))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize MicCustImportInvoiceComponent object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 MicCustImportInvoiceComponent object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output MicCustImportInvoiceComponent 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 MicCustImportInvoiceComponent, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, MicCustImportInvoiceComponent)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As MicCustImportInvoiceComponent) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As MicCustImportInvoiceComponent
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), MicCustImportInvoiceComponent)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As MicCustImportInvoiceComponent
|
|
Return CType(SerializerXml.Deserialize(s), MicCustImportInvoiceComponent)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current MicCustImportInvoiceComponent 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 MicCustImportInvoiceComponent object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output MicCustImportInvoiceComponent 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 MicCustImportInvoiceComponent, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, MicCustImportInvoiceComponent)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As MicCustImportInvoiceComponent) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As MicCustImportInvoiceComponent
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicInvoice
|
|
|
|
#Region "Private fields"
|
|
Private _invoiceNumber As String
|
|
|
|
Private _invoiceVersion As String
|
|
|
|
Private _invoiceDate As Date
|
|
|
|
Private _invoiceHead As TMicInvoiceHead
|
|
|
|
Private _attributes As TMicAttributes
|
|
|
|
Private _documents As TMicDocuments
|
|
|
|
Private _partners As TMicPartners
|
|
|
|
Private _atlasCompletionSumDs As TMicAtlasCompletionSumD
|
|
|
|
Private _intra As TMicCustIntra
|
|
|
|
Private _invoiceLines As TMicInvoiceLines
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._invoiceLines = New TMicInvoiceLines()
|
|
Me._intra = New TMicCustIntra()
|
|
Me._atlasCompletionSumDs = New TMicAtlasCompletionSumD()
|
|
Me._partners = New TMicPartners()
|
|
Me._documents = New TMicDocuments()
|
|
Me._attributes = New TMicAttributes()
|
|
Me._invoiceHead = New TMicInvoiceHead()
|
|
End Sub
|
|
|
|
Public Property invoiceNumber() As String
|
|
Get
|
|
Return Me._invoiceNumber
|
|
End Get
|
|
Set
|
|
Me._invoiceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property invoiceVersion() As String
|
|
Get
|
|
Return Me._invoiceVersion
|
|
End Get
|
|
Set
|
|
Me._invoiceVersion = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property invoiceDate() As Date
|
|
Get
|
|
Return Me._invoiceDate
|
|
End Get
|
|
Set
|
|
Me._invoiceDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property InvoiceHead() As TMicInvoiceHead
|
|
Get
|
|
Return Me._invoiceHead
|
|
End Get
|
|
Set
|
|
Me._invoiceHead = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Attributes() As TMicAttributes
|
|
Get
|
|
Return Me._attributes
|
|
End Get
|
|
Set
|
|
Me._attributes = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Documents() As TMicDocuments
|
|
Get
|
|
Return Me._documents
|
|
End Get
|
|
Set
|
|
Me._documents = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Partners() As TMicPartners
|
|
Get
|
|
Return Me._partners
|
|
End Get
|
|
Set
|
|
Me._partners = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property AtlasCompletionSumDs() As TMicAtlasCompletionSumD
|
|
Get
|
|
Return Me._atlasCompletionSumDs
|
|
End Get
|
|
Set
|
|
Me._atlasCompletionSumDs = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Intra() As TMicCustIntra
|
|
Get
|
|
Return Me._intra
|
|
End Get
|
|
Set
|
|
Me._intra = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property InvoiceLines() As TMicInvoiceLines
|
|
Get
|
|
Return Me._invoiceLines
|
|
End Get
|
|
Set
|
|
Me._invoiceLines = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInvoice))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicInvoice object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicInvoice object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicInvoice 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 TMicInvoice, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicInvoice)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicInvoice) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicInvoice
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInvoice)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicInvoice
|
|
Return CType(SerializerXml.Deserialize(s), TMicInvoice)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicInvoice 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicInvoice object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicInvoice 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 TMicInvoice, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicInvoice)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicInvoice) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicInvoice
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicInvoiceHead
|
|
|
|
#Region "Private fields"
|
|
Private _invoiceType As String
|
|
|
|
Private _contractDate As Date
|
|
|
|
Private _countryOfTrade As String
|
|
|
|
Private _supplier As TMicAddress
|
|
|
|
Private _grossWeight As Decimal
|
|
|
|
Private _netWeight As Decimal
|
|
|
|
Private _invoiceValue As Decimal
|
|
|
|
Private _invoiceCurrency As String
|
|
|
|
Private _deliveryTerms As TMicDelTerm
|
|
|
|
Private _rebate As TMicRebate
|
|
|
|
Private _discount As Decimal
|
|
|
|
Private _additionalCost As List(Of TMicAdditionalCosts)
|
|
|
|
Private _text As String
|
|
|
|
Private _text2 As String
|
|
|
|
Private _freight As TMicFreightCostsInv
|
|
|
|
Private _insurance As TMicInsuranceCostsInv
|
|
|
|
Private _crossingBorderDate As Date
|
|
|
|
Private _referenceNumber As String
|
|
|
|
Private _transportNumber As String
|
|
|
|
Private _transportType As String
|
|
|
|
Private _acceptanceDate As Date
|
|
|
|
Private _disposalDate As Date
|
|
|
|
Private _timeLimit As Date
|
|
|
|
Private _registrationNumber As String
|
|
|
|
Private _containerNumber As String
|
|
|
|
Private _sealNumber As String
|
|
|
|
Private _billOfLading As String
|
|
|
|
Private _packageCount As Decimal
|
|
|
|
Private _packageType As String
|
|
|
|
Private _buyer As String
|
|
|
|
Private _consignee As String
|
|
|
|
Private _paymentInformation As TMicImportPaymentInfo
|
|
|
|
Private _customerFields As TMicImportCustomerFields
|
|
|
|
Private _seller As TMicAddress
|
|
|
|
Private _exchangeRate As Decimal
|
|
|
|
Private _eliUnLocationCode As String
|
|
|
|
Private _eliCountry As String
|
|
|
|
Private _creationUser As String
|
|
|
|
Private _creationDate As Date
|
|
|
|
Private _modificationUser As String
|
|
|
|
Private _modificationDate As Date
|
|
|
|
Private _containerInfo As TMicContainer
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._containerInfo = New TMicContainer()
|
|
Me._seller = New TMicAddress()
|
|
Me._customerFields = New TMicImportCustomerFields()
|
|
Me._paymentInformation = New TMicImportPaymentInfo()
|
|
Me._insurance = New TMicInsuranceCostsInv()
|
|
Me._freight = New TMicFreightCostsInv()
|
|
Me._additionalCost = New List(Of TMicAdditionalCosts)()
|
|
Me._rebate = New TMicRebate()
|
|
Me._deliveryTerms = New TMicDelTerm()
|
|
Me._supplier = New TMicAddress()
|
|
End Sub
|
|
|
|
Public Property invoiceType() As String
|
|
Get
|
|
Return Me._invoiceType
|
|
End Get
|
|
Set
|
|
Me._invoiceType = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property contractDate() As Date
|
|
Get
|
|
Return Me._contractDate
|
|
End Get
|
|
Set
|
|
Me._contractDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property countryOfTrade() As String
|
|
Get
|
|
Return Me._countryOfTrade
|
|
End Get
|
|
Set
|
|
Me._countryOfTrade = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Supplier() As TMicAddress
|
|
Get
|
|
Return Me._supplier
|
|
End Get
|
|
Set
|
|
Me._supplier = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property grossWeight() As Decimal
|
|
Get
|
|
Return Me._grossWeight
|
|
End Get
|
|
Set
|
|
Me._grossWeight = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property netWeight() As Decimal
|
|
Get
|
|
Return Me._netWeight
|
|
End Get
|
|
Set
|
|
Me._netWeight = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property invoiceValue() As Decimal
|
|
Get
|
|
Return Me._invoiceValue
|
|
End Get
|
|
Set
|
|
Me._invoiceValue = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property invoiceCurrency() As String
|
|
Get
|
|
Return Me._invoiceCurrency
|
|
End Get
|
|
Set
|
|
Me._invoiceCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property deliveryTerms() As TMicDelTerm
|
|
Get
|
|
Return Me._deliveryTerms
|
|
End Get
|
|
Set
|
|
Me._deliveryTerms = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Rebate() As TMicRebate
|
|
Get
|
|
Return Me._rebate
|
|
End Get
|
|
Set
|
|
Me._rebate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property discount() As Decimal
|
|
Get
|
|
Return Me._discount
|
|
End Get
|
|
Set
|
|
Me._discount = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("AdditionalCost")>
|
|
Public Property AdditionalCost() As List(Of TMicAdditionalCosts)
|
|
Get
|
|
Return Me._additionalCost
|
|
End Get
|
|
Set
|
|
Me._additionalCost = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text() As String
|
|
Get
|
|
Return Me._text
|
|
End Get
|
|
Set
|
|
Me._text = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text2() As String
|
|
Get
|
|
Return Me._text2
|
|
End Get
|
|
Set
|
|
Me._text2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Freight() As TMicFreightCostsInv
|
|
Get
|
|
Return Me._freight
|
|
End Get
|
|
Set
|
|
Me._freight = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Insurance() As TMicInsuranceCostsInv
|
|
Get
|
|
Return Me._insurance
|
|
End Get
|
|
Set
|
|
Me._insurance = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property crossingBorderDate() As Date
|
|
Get
|
|
Return Me._crossingBorderDate
|
|
End Get
|
|
Set
|
|
Me._crossingBorderDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property referenceNumber() As String
|
|
Get
|
|
Return Me._referenceNumber
|
|
End Get
|
|
Set
|
|
Me._referenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property transportNumber() As String
|
|
Get
|
|
Return Me._transportNumber
|
|
End Get
|
|
Set
|
|
Me._transportNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property transportType() As String
|
|
Get
|
|
Return Me._transportType
|
|
End Get
|
|
Set
|
|
Me._transportType = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property acceptanceDate() As Date
|
|
Get
|
|
Return Me._acceptanceDate
|
|
End Get
|
|
Set
|
|
Me._acceptanceDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property disposalDate() As Date
|
|
Get
|
|
Return Me._disposalDate
|
|
End Get
|
|
Set
|
|
Me._disposalDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property timeLimit() As Date
|
|
Get
|
|
Return Me._timeLimit
|
|
End Get
|
|
Set
|
|
Me._timeLimit = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property registrationNumber() As String
|
|
Get
|
|
Return Me._registrationNumber
|
|
End Get
|
|
Set
|
|
Me._registrationNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property containerNumber() As String
|
|
Get
|
|
Return Me._containerNumber
|
|
End Get
|
|
Set
|
|
Me._containerNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property sealNumber() As String
|
|
Get
|
|
Return Me._sealNumber
|
|
End Get
|
|
Set
|
|
Me._sealNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property billOfLading() As String
|
|
Get
|
|
Return Me._billOfLading
|
|
End Get
|
|
Set
|
|
Me._billOfLading = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property packageCount() As Decimal
|
|
Get
|
|
Return Me._packageCount
|
|
End Get
|
|
Set
|
|
Me._packageCount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property packageType() As String
|
|
Get
|
|
Return Me._packageType
|
|
End Get
|
|
Set
|
|
Me._packageType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property buyer() As String
|
|
Get
|
|
Return Me._buyer
|
|
End Get
|
|
Set
|
|
Me._buyer = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property consignee() As String
|
|
Get
|
|
Return Me._consignee
|
|
End Get
|
|
Set
|
|
Me._consignee = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property PaymentInformation() As TMicImportPaymentInfo
|
|
Get
|
|
Return Me._paymentInformation
|
|
End Get
|
|
Set
|
|
Me._paymentInformation = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property CustomerFields() As TMicImportCustomerFields
|
|
Get
|
|
Return Me._customerFields
|
|
End Get
|
|
Set
|
|
Me._customerFields = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property seller() As TMicAddress
|
|
Get
|
|
Return Me._seller
|
|
End Get
|
|
Set
|
|
Me._seller = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exchangeRate() As Decimal
|
|
Get
|
|
Return Me._exchangeRate
|
|
End Get
|
|
Set
|
|
Me._exchangeRate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property eliUnLocationCode() As String
|
|
Get
|
|
Return Me._eliUnLocationCode
|
|
End Get
|
|
Set
|
|
Me._eliUnLocationCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property eliCountry() As String
|
|
Get
|
|
Return Me._eliCountry
|
|
End Get
|
|
Set
|
|
Me._eliCountry = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationUser() As String
|
|
Get
|
|
Return Me._creationUser
|
|
End Get
|
|
Set
|
|
Me._creationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationDate() As Date
|
|
Get
|
|
Return Me._creationDate
|
|
End Get
|
|
Set
|
|
Me._creationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationUser() As String
|
|
Get
|
|
Return Me._modificationUser
|
|
End Get
|
|
Set
|
|
Me._modificationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationDate() As Date
|
|
Get
|
|
Return Me._modificationDate
|
|
End Get
|
|
Set
|
|
Me._modificationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ContainerInfo() As TMicContainer
|
|
Get
|
|
Return Me._containerInfo
|
|
End Get
|
|
Set
|
|
Me._containerInfo = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInvoiceHead))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicInvoiceHead object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicInvoiceHead object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicInvoiceHead 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 TMicInvoiceHead, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicInvoiceHead)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicInvoiceHead) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicInvoiceHead
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInvoiceHead)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicInvoiceHead
|
|
Return CType(SerializerXml.Deserialize(s), TMicInvoiceHead)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicInvoiceHead 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicInvoiceHead object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicInvoiceHead 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 TMicInvoiceHead, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicInvoiceHead)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicInvoiceHead) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicInvoiceHead
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicAddress
|
|
|
|
#Region "Private fields"
|
|
Private _addrNo As String
|
|
|
|
Private _addrNoType As String
|
|
|
|
Private _addrName As List(Of String)
|
|
|
|
Private _addrStreet As String
|
|
|
|
Private _addrLoc As String
|
|
|
|
Private _addrCtry As String
|
|
|
|
Private _addrState As String
|
|
|
|
Private _addrZip As String
|
|
|
|
Private _addrTin As String
|
|
|
|
Private _addrEori As String
|
|
|
|
Private _partnerRelation As String
|
|
|
|
Private _addrDistrict As String
|
|
|
|
Private _addrBranchNo As String
|
|
|
|
Private _email As String
|
|
|
|
Private _addrVatNumber As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._addrName = New List(Of String)()
|
|
End Sub
|
|
|
|
Public Property addrNo() As String
|
|
Get
|
|
Return Me._addrNo
|
|
End Get
|
|
Set
|
|
Me._addrNo = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property addrNoType() As String
|
|
Get
|
|
Return Me._addrNoType
|
|
End Get
|
|
Set
|
|
Me._addrNoType = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("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 partnerRelation() As String
|
|
Get
|
|
Return Me._partnerRelation
|
|
End Get
|
|
Set
|
|
Me._partnerRelation = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property addrDistrict() As String
|
|
Get
|
|
Return Me._addrDistrict
|
|
End Get
|
|
Set
|
|
Me._addrDistrict = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property addrBranchNo() As String
|
|
Get
|
|
Return Me._addrBranchNo
|
|
End Get
|
|
Set
|
|
Me._addrBranchNo = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property email() As String
|
|
Get
|
|
Return Me._email
|
|
End Get
|
|
Set
|
|
Me._email = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property addrVatNumber() As String
|
|
Get
|
|
Return Me._addrVatNumber
|
|
End Get
|
|
Set
|
|
Me._addrVatNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAddress))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicAddress object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicAddress object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicAddress 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 TMicAddress, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicAddress)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicAddress) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicAddress
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicAddress)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicAddress
|
|
Return CType(SerializerXml.Deserialize(s), TMicAddress)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicAddress 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicAddress object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicAddress 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 TMicAddress, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicAddress)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicAddress) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicAddress
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicAuthHolder
|
|
|
|
#Region "Private fields"
|
|
Private _typeCode As String
|
|
|
|
Private _identifier As String
|
|
|
|
Private _referenceNumber As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property typeCode() As String
|
|
Get
|
|
Return Me._typeCode
|
|
End Get
|
|
Set
|
|
Me._typeCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property identifier() As String
|
|
Get
|
|
Return Me._identifier
|
|
End Get
|
|
Set
|
|
Me._identifier = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property referenceNumber() As String
|
|
Get
|
|
Return Me._referenceNumber
|
|
End Get
|
|
Set
|
|
Me._referenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAuthHolder))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicAuthHolder object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicAuthHolder object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicAuthHolder 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 TMicAuthHolder, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicAuthHolder)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicAuthHolder) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicAuthHolder
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicAuthHolder)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicAuthHolder
|
|
Return CType(SerializerXml.Deserialize(s), TMicAuthHolder)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicAuthHolder 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicAuthHolder object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicAuthHolder 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 TMicAuthHolder, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicAuthHolder)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicAuthHolder) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicAuthHolder
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicAuthHolders
|
|
|
|
#Region "Private fields"
|
|
Private _authorisationHolder As List(Of TMicAuthHolder)
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._authorisationHolder = New List(Of TMicAuthHolder)()
|
|
End Sub
|
|
|
|
<XmlElement("AuthorisationHolder")>
|
|
Public Property AuthorisationHolder() As List(Of TMicAuthHolder)
|
|
Get
|
|
Return Me._authorisationHolder
|
|
End Get
|
|
Set
|
|
Me._authorisationHolder = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAuthHolders))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicAuthHolders object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicAuthHolders object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicAuthHolders 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 TMicAuthHolders, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicAuthHolders)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicAuthHolders) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicAuthHolders
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicAuthHolders)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicAuthHolders
|
|
Return CType(SerializerXml.Deserialize(s), TMicAuthHolders)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicAuthHolders 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicAuthHolders object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicAuthHolders 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 TMicAuthHolders, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicAuthHolders)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicAuthHolders) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicAuthHolders
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicPackageData
|
|
|
|
#Region "Private fields"
|
|
Private _signo As String
|
|
|
|
Private _numberOfPackages As Long
|
|
|
|
Private _packageType As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property signo() As String
|
|
Get
|
|
Return Me._signo
|
|
End Get
|
|
Set
|
|
Me._signo = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property numberOfPackages() As Long
|
|
Get
|
|
Return Me._numberOfPackages
|
|
End Get
|
|
Set
|
|
Me._numberOfPackages = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property packageType() As String
|
|
Get
|
|
Return Me._packageType
|
|
End Get
|
|
Set
|
|
Me._packageType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPackageData))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicPackageData object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicPackageData object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicPackageData 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 TMicPackageData, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicPackageData)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicPackageData) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicPackageData
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicPackageData)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicPackageData
|
|
Return CType(SerializerXml.Deserialize(s), TMicPackageData)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicPackageData 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicPackageData object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicPackageData 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 TMicPackageData, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicPackageData)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicPackageData) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicPackageData
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicPackagesData
|
|
|
|
#Region "Private fields"
|
|
Private _packageData As List(Of TMicPackageData)
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._packageData = New List(Of TMicPackageData)()
|
|
End Sub
|
|
|
|
<XmlElement("PackageData")>
|
|
Public Property PackageData() As List(Of TMicPackageData)
|
|
Get
|
|
Return Me._packageData
|
|
End Get
|
|
Set
|
|
Me._packageData = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPackagesData))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicPackagesData object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicPackagesData object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicPackagesData 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 TMicPackagesData, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicPackagesData)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicPackagesData) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicPackagesData
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicPackagesData)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicPackagesData
|
|
Return CType(SerializerXml.Deserialize(s), TMicPackagesData)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicPackagesData 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicPackagesData object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicPackagesData 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 TMicPackagesData, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicPackagesData)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicPackagesData) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicPackagesData
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TReferencePreviousProcedure
|
|
|
|
#Region "Private fields"
|
|
Private _referenceType As String
|
|
|
|
Private _referenceNumber As String
|
|
|
|
Private _authorisationNumber As String
|
|
|
|
Private _registrationNumber As String
|
|
|
|
Private _positionNumber As Long
|
|
|
|
Private _partNumber As String
|
|
|
|
Private _tariffNumber As String
|
|
|
|
Private _tradeQuantity As Decimal
|
|
|
|
Private _tradeUnitOfMeasurement As String
|
|
|
|
Private _tradeQualifier As String
|
|
|
|
Private _deductionQuantity As Decimal
|
|
|
|
Private _deductionUnitOfMeasurement As String
|
|
|
|
Private _deductionQualifier As String
|
|
|
|
Private _additionalInformation As String
|
|
|
|
Private _normalTreatmentFlag As Boolean
|
|
|
|
Private _atlasFlag As Boolean
|
|
|
|
Private _customsNumber As String
|
|
|
|
Private _statisticalQuantity As Decimal
|
|
|
|
Private _netMass As Decimal
|
|
|
|
Private _grossMass As Decimal
|
|
|
|
Private _packageQuantity As Decimal
|
|
|
|
Private _simpleIprApplication As Boolean
|
|
|
|
Private _supervisingOffice As String
|
|
|
|
Private _packageType As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property referenceType() As String
|
|
Get
|
|
Return Me._referenceType
|
|
End Get
|
|
Set
|
|
Me._referenceType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property referenceNumber() As String
|
|
Get
|
|
Return Me._referenceNumber
|
|
End Get
|
|
Set
|
|
Me._referenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property authorisationNumber() As String
|
|
Get
|
|
Return Me._authorisationNumber
|
|
End Get
|
|
Set
|
|
Me._authorisationNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property registrationNumber() As String
|
|
Get
|
|
Return Me._registrationNumber
|
|
End Get
|
|
Set
|
|
Me._registrationNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property positionNumber() As Long
|
|
Get
|
|
Return Me._positionNumber
|
|
End Get
|
|
Set
|
|
Me._positionNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property partNumber() As String
|
|
Get
|
|
Return Me._partNumber
|
|
End Get
|
|
Set
|
|
Me._partNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property tariffNumber() As String
|
|
Get
|
|
Return Me._tariffNumber
|
|
End Get
|
|
Set
|
|
Me._tariffNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property tradeQuantity() As Decimal
|
|
Get
|
|
Return Me._tradeQuantity
|
|
End Get
|
|
Set
|
|
Me._tradeQuantity = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property tradeUnitOfMeasurement() As String
|
|
Get
|
|
Return Me._tradeUnitOfMeasurement
|
|
End Get
|
|
Set
|
|
Me._tradeUnitOfMeasurement = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property tradeQualifier() As String
|
|
Get
|
|
Return Me._tradeQualifier
|
|
End Get
|
|
Set
|
|
Me._tradeQualifier = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property deductionQuantity() As Decimal
|
|
Get
|
|
Return Me._deductionQuantity
|
|
End Get
|
|
Set
|
|
Me._deductionQuantity = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property deductionUnitOfMeasurement() As String
|
|
Get
|
|
Return Me._deductionUnitOfMeasurement
|
|
End Get
|
|
Set
|
|
Me._deductionUnitOfMeasurement = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property deductionQualifier() As String
|
|
Get
|
|
Return Me._deductionQualifier
|
|
End Get
|
|
Set
|
|
Me._deductionQualifier = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalInformation() As String
|
|
Get
|
|
Return Me._additionalInformation
|
|
End Get
|
|
Set
|
|
Me._additionalInformation = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property normalTreatmentFlag() As Boolean
|
|
Get
|
|
Return Me._normalTreatmentFlag
|
|
End Get
|
|
Set
|
|
Me._normalTreatmentFlag = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property atlasFlag() As Boolean
|
|
Get
|
|
Return Me._atlasFlag
|
|
End Get
|
|
Set
|
|
Me._atlasFlag = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property customsNumber() As String
|
|
Get
|
|
Return Me._customsNumber
|
|
End Get
|
|
Set
|
|
Me._customsNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property statisticalQuantity() As Decimal
|
|
Get
|
|
Return Me._statisticalQuantity
|
|
End Get
|
|
Set
|
|
Me._statisticalQuantity = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property netMass() As Decimal
|
|
Get
|
|
Return Me._netMass
|
|
End Get
|
|
Set
|
|
Me._netMass = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property grossMass() As Decimal
|
|
Get
|
|
Return Me._grossMass
|
|
End Get
|
|
Set
|
|
Me._grossMass = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property packageQuantity() As Decimal
|
|
Get
|
|
Return Me._packageQuantity
|
|
End Get
|
|
Set
|
|
Me._packageQuantity = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property simpleIprApplication() As Boolean
|
|
Get
|
|
Return Me._simpleIprApplication
|
|
End Get
|
|
Set
|
|
Me._simpleIprApplication = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property supervisingOffice() As String
|
|
Get
|
|
Return Me._supervisingOffice
|
|
End Get
|
|
Set
|
|
Me._supervisingOffice = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property packageType() As String
|
|
Get
|
|
Return Me._packageType
|
|
End Get
|
|
Set
|
|
Me._packageType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TReferencePreviousProcedure))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TReferencePreviousProcedure object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TReferencePreviousProcedure object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TReferencePreviousProcedure 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 TReferencePreviousProcedure, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TReferencePreviousProcedure)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TReferencePreviousProcedure) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TReferencePreviousProcedure
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TReferencePreviousProcedure)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TReferencePreviousProcedure
|
|
Return CType(SerializerXml.Deserialize(s), TReferencePreviousProcedure)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TReferencePreviousProcedure 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TReferencePreviousProcedure object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TReferencePreviousProcedure 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 TReferencePreviousProcedure, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TReferencePreviousProcedure)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TReferencePreviousProcedure) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TReferencePreviousProcedure
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TReferencePreviousProcedures
|
|
|
|
#Region "Private fields"
|
|
Private _referencePreviousProcedure As List(Of TReferencePreviousProcedure)
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._referencePreviousProcedure = New List(Of TReferencePreviousProcedure)()
|
|
End Sub
|
|
|
|
<XmlElement("ReferencePreviousProcedure")>
|
|
Public Property ReferencePreviousProcedure() As List(Of TReferencePreviousProcedure)
|
|
Get
|
|
Return Me._referencePreviousProcedure
|
|
End Get
|
|
Set
|
|
Me._referencePreviousProcedure = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TReferencePreviousProcedures))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TReferencePreviousProcedures object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TReferencePreviousProcedures object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TReferencePreviousProcedures 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 TReferencePreviousProcedures, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TReferencePreviousProcedures)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TReferencePreviousProcedures) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TReferencePreviousProcedures
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TReferencePreviousProcedures)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TReferencePreviousProcedures
|
|
Return CType(SerializerXml.Deserialize(s), TReferencePreviousProcedures)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TReferencePreviousProcedures 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TReferencePreviousProcedures object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TReferencePreviousProcedures 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 TReferencePreviousProcedures, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TReferencePreviousProcedures)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TReferencePreviousProcedures) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TReferencePreviousProcedures
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicPreSupplier
|
|
|
|
#Region "Private fields"
|
|
Private _infDutyValue As Decimal
|
|
|
|
Private _infDutyRate As Decimal
|
|
|
|
Private _infDuty As Decimal
|
|
|
|
Private _infDutyCurrency As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property infDutyValue() As Decimal
|
|
Get
|
|
Return Me._infDutyValue
|
|
End Get
|
|
Set
|
|
Me._infDutyValue = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property infDutyRate() As Decimal
|
|
Get
|
|
Return Me._infDutyRate
|
|
End Get
|
|
Set
|
|
Me._infDutyRate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property infDuty() As Decimal
|
|
Get
|
|
Return Me._infDuty
|
|
End Get
|
|
Set
|
|
Me._infDuty = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property infDutyCurrency() As String
|
|
Get
|
|
Return Me._infDutyCurrency
|
|
End Get
|
|
Set
|
|
Me._infDutyCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPreSupplier))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicPreSupplier object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicPreSupplier object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicPreSupplier 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 TMicPreSupplier, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicPreSupplier)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicPreSupplier) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicPreSupplier
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicPreSupplier)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicPreSupplier
|
|
Return CType(SerializerXml.Deserialize(s), TMicPreSupplier)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicPreSupplier 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicPreSupplier object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicPreSupplier 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 TMicPreSupplier, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicPreSupplier)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicPreSupplier) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicPreSupplier
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicCustIntraLine
|
|
|
|
#Region "Private fields"
|
|
Private _status As String
|
|
|
|
Private _invoiceDate As Date
|
|
|
|
Private _period As Long
|
|
|
|
Private _region As String
|
|
|
|
Private _statisticalProcedure As String
|
|
|
|
Private _statisticalValue As Decimal
|
|
|
|
Private _additionalCostsCurrency1 As String
|
|
|
|
Private _additionalCostsType1 As String
|
|
|
|
Private _additionalCostsCurrency2 As String
|
|
|
|
Private _additionalCostsType2 As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property status() As String
|
|
Get
|
|
Return Me._status
|
|
End Get
|
|
Set
|
|
Me._status = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property invoiceDate() As Date
|
|
Get
|
|
Return Me._invoiceDate
|
|
End Get
|
|
Set
|
|
Me._invoiceDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property period() As Long
|
|
Get
|
|
Return Me._period
|
|
End Get
|
|
Set
|
|
Me._period = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property region() As String
|
|
Get
|
|
Return Me._region
|
|
End Get
|
|
Set
|
|
Me._region = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property statisticalProcedure() As String
|
|
Get
|
|
Return Me._statisticalProcedure
|
|
End Get
|
|
Set
|
|
Me._statisticalProcedure = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property statisticalValue() As Decimal
|
|
Get
|
|
Return Me._statisticalValue
|
|
End Get
|
|
Set
|
|
Me._statisticalValue = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCostsCurrency1() As String
|
|
Get
|
|
Return Me._additionalCostsCurrency1
|
|
End Get
|
|
Set
|
|
Me._additionalCostsCurrency1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCostsType1() As String
|
|
Get
|
|
Return Me._additionalCostsType1
|
|
End Get
|
|
Set
|
|
Me._additionalCostsType1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCostsCurrency2() As String
|
|
Get
|
|
Return Me._additionalCostsCurrency2
|
|
End Get
|
|
Set
|
|
Me._additionalCostsCurrency2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCostsType2() As String
|
|
Get
|
|
Return Me._additionalCostsType2
|
|
End Get
|
|
Set
|
|
Me._additionalCostsType2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicCustIntraLine))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicCustIntraLine object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicCustIntraLine object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicCustIntraLine 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 TMicCustIntraLine, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicCustIntraLine)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicCustIntraLine) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicCustIntraLine
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicCustIntraLine)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicCustIntraLine
|
|
Return CType(SerializerXml.Deserialize(s), TMicCustIntraLine)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicCustIntraLine 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicCustIntraLine object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicCustIntraLine 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 TMicCustIntraLine, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicCustIntraLine)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicCustIntraLine) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicCustIntraLine
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicImportLineAdditionalParams
|
|
|
|
#Region "Private fields"
|
|
Private _cancel As String
|
|
|
|
Private _codeNumber As String
|
|
|
|
Private _countryGroup As String
|
|
|
|
Private _condition1 As String
|
|
|
|
Private _condition2 As String
|
|
|
|
Private _vehicleTobaccoCode As String
|
|
|
|
Private _specialProvision As String
|
|
|
|
Private _relecantTime As Date
|
|
|
|
Private _relecantTimePreference As Date
|
|
|
|
Private _countryOfExportation As String
|
|
|
|
Private _originCountry As String
|
|
|
|
Private _purchaseCountry As String
|
|
|
|
Private _defaultPrefDocType As String
|
|
|
|
Private _defaultPrefDocSubType As String
|
|
|
|
Private _temporarity As String
|
|
|
|
Private _standardTreatment As String
|
|
|
|
Private _quota1 As String
|
|
|
|
Private _quotaNumber1 As String
|
|
|
|
Private _quotaNumber2 As String
|
|
|
|
Private _quota3 As String
|
|
|
|
Private _quotaNumber3 As String
|
|
|
|
Private _quotaAdditionalCodeFlag1 As String
|
|
|
|
Private _quotaAdditionalCode1 As String
|
|
|
|
Private _quotaAdditionalCodeFlag2 As String
|
|
|
|
Private _quotaAdditionalCode2 As String
|
|
|
|
Private _quotaAdditionalCodeFlag3 As String
|
|
|
|
Private _quotaAdditionalCode3 As String
|
|
|
|
Private _procedureCode As String
|
|
|
|
Private _customsCalculationCode As String
|
|
|
|
Private _customsCalculationZ As String
|
|
|
|
Private _customsQuantity As Decimal
|
|
|
|
Private _unitCustomsQuantity As String
|
|
|
|
Private _customsValue As Decimal
|
|
|
|
Private _levyUnit As Decimal
|
|
|
|
Private _levyUnitUom As String
|
|
|
|
Private _specialUnit As Decimal
|
|
|
|
Private _specialUnitUom As String
|
|
|
|
Private _specialValue As Decimal
|
|
|
|
Private _salaryType1 As String
|
|
|
|
Private _salaryShare1 As Decimal
|
|
|
|
Private _salaryType2 As String
|
|
|
|
Private _salaryShare2 As Decimal
|
|
|
|
Private _salaryType3 As String
|
|
|
|
Private _salaryShare3 As Decimal
|
|
|
|
Private _salaryType4 As String
|
|
|
|
Private _salaryShare4 As Decimal
|
|
|
|
Private _salaryType5 As String
|
|
|
|
Private _salaryShare5 As Decimal
|
|
|
|
Private _salaryType6 As String
|
|
|
|
Private _salaryShare6 As Decimal
|
|
|
|
Private _exciseTax1 As String
|
|
|
|
Private _exciseTaxQuantity1 As Decimal
|
|
|
|
Private _exciseTaxUom1 As String
|
|
|
|
Private _exciseTaxValue1 As Decimal
|
|
|
|
Private _exciseTaxShare1 As Decimal
|
|
|
|
Private _exciseTax2 As String
|
|
|
|
Private _exciseTaxQuantity2 As Decimal
|
|
|
|
Private _exciseTaxUom2 As String
|
|
|
|
Private _exciseTaxValue2 As Decimal
|
|
|
|
Private _exciseTaxShare2 As Decimal
|
|
|
|
Private _exciseTax3 As String
|
|
|
|
Private _exciseTaxQuantity3 As Decimal
|
|
|
|
Private _exciseTaxUom3 As String
|
|
|
|
Private _exciseTaxValue3 As Decimal
|
|
|
|
Private _exciseTaxShare3 As Decimal
|
|
|
|
Private _exciseTax4 As String
|
|
|
|
Private _exciseTaxQuantity4 As Decimal
|
|
|
|
Private _exciseTaxUom4 As String
|
|
|
|
Private _exciseTaxValue4 As Decimal
|
|
|
|
Private _exciseTaxShare4 As Decimal
|
|
|
|
Private _exciseTax5 As String
|
|
|
|
Private _exciseTaxQuantity5 As Decimal
|
|
|
|
Private _exciseTaxUom5 As String
|
|
|
|
Private _exciseTaxValue5 As Decimal
|
|
|
|
Private _exciseTaxShare5 As Decimal
|
|
|
|
Private _exciseTax6 As String
|
|
|
|
Private _exciseTaxQuantity6 As Decimal
|
|
|
|
Private _exciseTaxUom6 As String
|
|
|
|
Private _exciseTaxValue6 As Decimal
|
|
|
|
Private _exciseTaxShare6 As Decimal
|
|
|
|
Private _specialCaseGroup1 As String
|
|
|
|
Private _specialCaseType1 As String
|
|
|
|
Private _specialCaseRate1 As Decimal
|
|
|
|
Private _specialCaseGroup2 As String
|
|
|
|
Private _specialCaseType2 As String
|
|
|
|
Private _specialCaseRate2 As Decimal
|
|
|
|
Private _specialCaseGroup3 As String
|
|
|
|
Private _specialCaseType3 As String
|
|
|
|
Private _specialCaseRate3 As Decimal
|
|
|
|
Private _ivatCosts As Decimal
|
|
|
|
Private _efagen As String
|
|
|
|
Private _certificates As String
|
|
|
|
Private _standards As String
|
|
|
|
Private _importControl As String
|
|
|
|
Private _insurance As String
|
|
|
|
Private _establishment As String
|
|
|
|
Private _procedure As String
|
|
|
|
Private _licenseType As String
|
|
|
|
Private _licenseNumber As String
|
|
|
|
Private _exciseTaxQualificator1 As String
|
|
|
|
Private _exciseTaxQualificator2 As String
|
|
|
|
Private _exciseTaxQualificator3 As String
|
|
|
|
Private _exciseTaxQualificator4 As String
|
|
|
|
Private _exciseTaxQualificator5 As String
|
|
|
|
Private _exciseTaxQualificator6 As String
|
|
|
|
Private _quota As Decimal
|
|
|
|
Private _quotaUom As String
|
|
|
|
Private _quotaQualificator As String
|
|
|
|
Private _location As String
|
|
|
|
Private _taxCode1 As Long
|
|
|
|
Private _taxCode2 As Long
|
|
|
|
Private _taxCode3 As Long
|
|
|
|
Private _taxCode4 As Long
|
|
|
|
Private _taxCode5 As Long
|
|
|
|
Private _taxCode6 As Long
|
|
|
|
Private _tobaccoFlagNumber As String
|
|
|
|
Private _subjectArea As String
|
|
|
|
Private _completeInfoFlag As String
|
|
|
|
Private _statisticStatus As String
|
|
|
|
Private _chargeType As String
|
|
|
|
Private _indirectPayment As Long
|
|
|
|
Private _indirectPaymentCurrency As String
|
|
|
|
Private _indirectPaymentFlag As String
|
|
|
|
Private _indirectPaymentRate As Long
|
|
|
|
Private _messageFlag22 As String
|
|
|
|
Private _messageFlag55 As String
|
|
|
|
Private _messageFlag77 As String
|
|
|
|
Private _messageFlag90 As String
|
|
|
|
Private _tariffNumber As String
|
|
|
|
Private _shippingCountry As String
|
|
|
|
Private _countryOfOrigin As String
|
|
|
|
Private _netWeight As Decimal
|
|
|
|
Private _partPrice As Long
|
|
|
|
Private _prefRequestCode As String
|
|
|
|
Private _positionNumber As Long
|
|
|
|
Private _additionalCostsIVAT As Decimal
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property cancel() As String
|
|
Get
|
|
Return Me._cancel
|
|
End Get
|
|
Set
|
|
Me._cancel = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property codeNumber() As String
|
|
Get
|
|
Return Me._codeNumber
|
|
End Get
|
|
Set
|
|
Me._codeNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property countryGroup() As String
|
|
Get
|
|
Return Me._countryGroup
|
|
End Get
|
|
Set
|
|
Me._countryGroup = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property condition1() As String
|
|
Get
|
|
Return Me._condition1
|
|
End Get
|
|
Set
|
|
Me._condition1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property condition2() As String
|
|
Get
|
|
Return Me._condition2
|
|
End Get
|
|
Set
|
|
Me._condition2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property vehicleTobaccoCode() As String
|
|
Get
|
|
Return Me._vehicleTobaccoCode
|
|
End Get
|
|
Set
|
|
Me._vehicleTobaccoCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property specialProvision() As String
|
|
Get
|
|
Return Me._specialProvision
|
|
End Get
|
|
Set
|
|
Me._specialProvision = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property relecantTime() As Date
|
|
Get
|
|
Return Me._relecantTime
|
|
End Get
|
|
Set
|
|
Me._relecantTime = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property relecantTimePreference() As Date
|
|
Get
|
|
Return Me._relecantTimePreference
|
|
End Get
|
|
Set
|
|
Me._relecantTimePreference = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property countryOfExportation() As String
|
|
Get
|
|
Return Me._countryOfExportation
|
|
End Get
|
|
Set
|
|
Me._countryOfExportation = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property originCountry() As String
|
|
Get
|
|
Return Me._originCountry
|
|
End Get
|
|
Set
|
|
Me._originCountry = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property purchaseCountry() As String
|
|
Get
|
|
Return Me._purchaseCountry
|
|
End Get
|
|
Set
|
|
Me._purchaseCountry = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property defaultPrefDocType() As String
|
|
Get
|
|
Return Me._defaultPrefDocType
|
|
End Get
|
|
Set
|
|
Me._defaultPrefDocType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property defaultPrefDocSubType() As String
|
|
Get
|
|
Return Me._defaultPrefDocSubType
|
|
End Get
|
|
Set
|
|
Me._defaultPrefDocSubType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property temporarity() As String
|
|
Get
|
|
Return Me._temporarity
|
|
End Get
|
|
Set
|
|
Me._temporarity = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property standardTreatment() As String
|
|
Get
|
|
Return Me._standardTreatment
|
|
End Get
|
|
Set
|
|
Me._standardTreatment = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property quota1() As String
|
|
Get
|
|
Return Me._quota1
|
|
End Get
|
|
Set
|
|
Me._quota1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property quotaNumber1() As String
|
|
Get
|
|
Return Me._quotaNumber1
|
|
End Get
|
|
Set
|
|
Me._quotaNumber1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property quotaNumber2() As String
|
|
Get
|
|
Return Me._quotaNumber2
|
|
End Get
|
|
Set
|
|
Me._quotaNumber2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property quota3() As String
|
|
Get
|
|
Return Me._quota3
|
|
End Get
|
|
Set
|
|
Me._quota3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property quotaNumber3() As String
|
|
Get
|
|
Return Me._quotaNumber3
|
|
End Get
|
|
Set
|
|
Me._quotaNumber3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property quotaAdditionalCodeFlag1() As String
|
|
Get
|
|
Return Me._quotaAdditionalCodeFlag1
|
|
End Get
|
|
Set
|
|
Me._quotaAdditionalCodeFlag1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property quotaAdditionalCode1() As String
|
|
Get
|
|
Return Me._quotaAdditionalCode1
|
|
End Get
|
|
Set
|
|
Me._quotaAdditionalCode1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property quotaAdditionalCodeFlag2() As String
|
|
Get
|
|
Return Me._quotaAdditionalCodeFlag2
|
|
End Get
|
|
Set
|
|
Me._quotaAdditionalCodeFlag2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property quotaAdditionalCode2() As String
|
|
Get
|
|
Return Me._quotaAdditionalCode2
|
|
End Get
|
|
Set
|
|
Me._quotaAdditionalCode2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property quotaAdditionalCodeFlag3() As String
|
|
Get
|
|
Return Me._quotaAdditionalCodeFlag3
|
|
End Get
|
|
Set
|
|
Me._quotaAdditionalCodeFlag3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property quotaAdditionalCode3() As String
|
|
Get
|
|
Return Me._quotaAdditionalCode3
|
|
End Get
|
|
Set
|
|
Me._quotaAdditionalCode3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property procedureCode() As String
|
|
Get
|
|
Return Me._procedureCode
|
|
End Get
|
|
Set
|
|
Me._procedureCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property customsCalculationCode() As String
|
|
Get
|
|
Return Me._customsCalculationCode
|
|
End Get
|
|
Set
|
|
Me._customsCalculationCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property customsCalculationZ() As String
|
|
Get
|
|
Return Me._customsCalculationZ
|
|
End Get
|
|
Set
|
|
Me._customsCalculationZ = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property customsQuantity() As Decimal
|
|
Get
|
|
Return Me._customsQuantity
|
|
End Get
|
|
Set
|
|
Me._customsQuantity = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property unitCustomsQuantity() As String
|
|
Get
|
|
Return Me._unitCustomsQuantity
|
|
End Get
|
|
Set
|
|
Me._unitCustomsQuantity = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property customsValue() As Decimal
|
|
Get
|
|
Return Me._customsValue
|
|
End Get
|
|
Set
|
|
Me._customsValue = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property levyUnit() As Decimal
|
|
Get
|
|
Return Me._levyUnit
|
|
End Get
|
|
Set
|
|
Me._levyUnit = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property levyUnitUom() As String
|
|
Get
|
|
Return Me._levyUnitUom
|
|
End Get
|
|
Set
|
|
Me._levyUnitUom = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property specialUnit() As Decimal
|
|
Get
|
|
Return Me._specialUnit
|
|
End Get
|
|
Set
|
|
Me._specialUnit = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property specialUnitUom() As String
|
|
Get
|
|
Return Me._specialUnitUom
|
|
End Get
|
|
Set
|
|
Me._specialUnitUom = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property specialValue() As Decimal
|
|
Get
|
|
Return Me._specialValue
|
|
End Get
|
|
Set
|
|
Me._specialValue = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property salaryType1() As String
|
|
Get
|
|
Return Me._salaryType1
|
|
End Get
|
|
Set
|
|
Me._salaryType1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property salaryShare1() As Decimal
|
|
Get
|
|
Return Me._salaryShare1
|
|
End Get
|
|
Set
|
|
Me._salaryShare1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property salaryType2() As String
|
|
Get
|
|
Return Me._salaryType2
|
|
End Get
|
|
Set
|
|
Me._salaryType2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property salaryShare2() As Decimal
|
|
Get
|
|
Return Me._salaryShare2
|
|
End Get
|
|
Set
|
|
Me._salaryShare2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property salaryType3() As String
|
|
Get
|
|
Return Me._salaryType3
|
|
End Get
|
|
Set
|
|
Me._salaryType3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property salaryShare3() As Decimal
|
|
Get
|
|
Return Me._salaryShare3
|
|
End Get
|
|
Set
|
|
Me._salaryShare3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property salaryType4() As String
|
|
Get
|
|
Return Me._salaryType4
|
|
End Get
|
|
Set
|
|
Me._salaryType4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property salaryShare4() As Decimal
|
|
Get
|
|
Return Me._salaryShare4
|
|
End Get
|
|
Set
|
|
Me._salaryShare4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property salaryType5() As String
|
|
Get
|
|
Return Me._salaryType5
|
|
End Get
|
|
Set
|
|
Me._salaryType5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property salaryShare5() As Decimal
|
|
Get
|
|
Return Me._salaryShare5
|
|
End Get
|
|
Set
|
|
Me._salaryShare5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property salaryType6() As String
|
|
Get
|
|
Return Me._salaryType6
|
|
End Get
|
|
Set
|
|
Me._salaryType6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property salaryShare6() As Decimal
|
|
Get
|
|
Return Me._salaryShare6
|
|
End Get
|
|
Set
|
|
Me._salaryShare6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTax1() As String
|
|
Get
|
|
Return Me._exciseTax1
|
|
End Get
|
|
Set
|
|
Me._exciseTax1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxQuantity1() As Decimal
|
|
Get
|
|
Return Me._exciseTaxQuantity1
|
|
End Get
|
|
Set
|
|
Me._exciseTaxQuantity1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxUom1() As String
|
|
Get
|
|
Return Me._exciseTaxUom1
|
|
End Get
|
|
Set
|
|
Me._exciseTaxUom1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxValue1() As Decimal
|
|
Get
|
|
Return Me._exciseTaxValue1
|
|
End Get
|
|
Set
|
|
Me._exciseTaxValue1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxShare1() As Decimal
|
|
Get
|
|
Return Me._exciseTaxShare1
|
|
End Get
|
|
Set
|
|
Me._exciseTaxShare1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTax2() As String
|
|
Get
|
|
Return Me._exciseTax2
|
|
End Get
|
|
Set
|
|
Me._exciseTax2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxQuantity2() As Decimal
|
|
Get
|
|
Return Me._exciseTaxQuantity2
|
|
End Get
|
|
Set
|
|
Me._exciseTaxQuantity2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxUom2() As String
|
|
Get
|
|
Return Me._exciseTaxUom2
|
|
End Get
|
|
Set
|
|
Me._exciseTaxUom2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxValue2() As Decimal
|
|
Get
|
|
Return Me._exciseTaxValue2
|
|
End Get
|
|
Set
|
|
Me._exciseTaxValue2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxShare2() As Decimal
|
|
Get
|
|
Return Me._exciseTaxShare2
|
|
End Get
|
|
Set
|
|
Me._exciseTaxShare2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTax3() As String
|
|
Get
|
|
Return Me._exciseTax3
|
|
End Get
|
|
Set
|
|
Me._exciseTax3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxQuantity3() As Decimal
|
|
Get
|
|
Return Me._exciseTaxQuantity3
|
|
End Get
|
|
Set
|
|
Me._exciseTaxQuantity3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxUom3() As String
|
|
Get
|
|
Return Me._exciseTaxUom3
|
|
End Get
|
|
Set
|
|
Me._exciseTaxUom3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxValue3() As Decimal
|
|
Get
|
|
Return Me._exciseTaxValue3
|
|
End Get
|
|
Set
|
|
Me._exciseTaxValue3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxShare3() As Decimal
|
|
Get
|
|
Return Me._exciseTaxShare3
|
|
End Get
|
|
Set
|
|
Me._exciseTaxShare3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTax4() As String
|
|
Get
|
|
Return Me._exciseTax4
|
|
End Get
|
|
Set
|
|
Me._exciseTax4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxQuantity4() As Decimal
|
|
Get
|
|
Return Me._exciseTaxQuantity4
|
|
End Get
|
|
Set
|
|
Me._exciseTaxQuantity4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxUom4() As String
|
|
Get
|
|
Return Me._exciseTaxUom4
|
|
End Get
|
|
Set
|
|
Me._exciseTaxUom4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxValue4() As Decimal
|
|
Get
|
|
Return Me._exciseTaxValue4
|
|
End Get
|
|
Set
|
|
Me._exciseTaxValue4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxShare4() As Decimal
|
|
Get
|
|
Return Me._exciseTaxShare4
|
|
End Get
|
|
Set
|
|
Me._exciseTaxShare4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTax5() As String
|
|
Get
|
|
Return Me._exciseTax5
|
|
End Get
|
|
Set
|
|
Me._exciseTax5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxQuantity5() As Decimal
|
|
Get
|
|
Return Me._exciseTaxQuantity5
|
|
End Get
|
|
Set
|
|
Me._exciseTaxQuantity5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxUom5() As String
|
|
Get
|
|
Return Me._exciseTaxUom5
|
|
End Get
|
|
Set
|
|
Me._exciseTaxUom5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxValue5() As Decimal
|
|
Get
|
|
Return Me._exciseTaxValue5
|
|
End Get
|
|
Set
|
|
Me._exciseTaxValue5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxShare5() As Decimal
|
|
Get
|
|
Return Me._exciseTaxShare5
|
|
End Get
|
|
Set
|
|
Me._exciseTaxShare5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTax6() As String
|
|
Get
|
|
Return Me._exciseTax6
|
|
End Get
|
|
Set
|
|
Me._exciseTax6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxQuantity6() As Decimal
|
|
Get
|
|
Return Me._exciseTaxQuantity6
|
|
End Get
|
|
Set
|
|
Me._exciseTaxQuantity6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxUom6() As String
|
|
Get
|
|
Return Me._exciseTaxUom6
|
|
End Get
|
|
Set
|
|
Me._exciseTaxUom6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxValue6() As Decimal
|
|
Get
|
|
Return Me._exciseTaxValue6
|
|
End Get
|
|
Set
|
|
Me._exciseTaxValue6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxShare6() As Decimal
|
|
Get
|
|
Return Me._exciseTaxShare6
|
|
End Get
|
|
Set
|
|
Me._exciseTaxShare6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property specialCaseGroup1() As String
|
|
Get
|
|
Return Me._specialCaseGroup1
|
|
End Get
|
|
Set
|
|
Me._specialCaseGroup1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property specialCaseType1() As String
|
|
Get
|
|
Return Me._specialCaseType1
|
|
End Get
|
|
Set
|
|
Me._specialCaseType1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property specialCaseRate1() As Decimal
|
|
Get
|
|
Return Me._specialCaseRate1
|
|
End Get
|
|
Set
|
|
Me._specialCaseRate1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property specialCaseGroup2() As String
|
|
Get
|
|
Return Me._specialCaseGroup2
|
|
End Get
|
|
Set
|
|
Me._specialCaseGroup2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property specialCaseType2() As String
|
|
Get
|
|
Return Me._specialCaseType2
|
|
End Get
|
|
Set
|
|
Me._specialCaseType2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property specialCaseRate2() As Decimal
|
|
Get
|
|
Return Me._specialCaseRate2
|
|
End Get
|
|
Set
|
|
Me._specialCaseRate2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property specialCaseGroup3() As String
|
|
Get
|
|
Return Me._specialCaseGroup3
|
|
End Get
|
|
Set
|
|
Me._specialCaseGroup3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property specialCaseType3() As String
|
|
Get
|
|
Return Me._specialCaseType3
|
|
End Get
|
|
Set
|
|
Me._specialCaseType3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property specialCaseRate3() As Decimal
|
|
Get
|
|
Return Me._specialCaseRate3
|
|
End Get
|
|
Set
|
|
Me._specialCaseRate3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ivatCosts() As Decimal
|
|
Get
|
|
Return Me._ivatCosts
|
|
End Get
|
|
Set
|
|
Me._ivatCosts = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property efagen() As String
|
|
Get
|
|
Return Me._efagen
|
|
End Get
|
|
Set
|
|
Me._efagen = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property certificates() As String
|
|
Get
|
|
Return Me._certificates
|
|
End Get
|
|
Set
|
|
Me._certificates = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property standards() As String
|
|
Get
|
|
Return Me._standards
|
|
End Get
|
|
Set
|
|
Me._standards = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property importControl() As String
|
|
Get
|
|
Return Me._importControl
|
|
End Get
|
|
Set
|
|
Me._importControl = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property insurance() As String
|
|
Get
|
|
Return Me._insurance
|
|
End Get
|
|
Set
|
|
Me._insurance = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property establishment() As String
|
|
Get
|
|
Return Me._establishment
|
|
End Get
|
|
Set
|
|
Me._establishment = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property procedure() As String
|
|
Get
|
|
Return Me._procedure
|
|
End Get
|
|
Set
|
|
Me._procedure = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property licenseType() As String
|
|
Get
|
|
Return Me._licenseType
|
|
End Get
|
|
Set
|
|
Me._licenseType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property licenseNumber() As String
|
|
Get
|
|
Return Me._licenseNumber
|
|
End Get
|
|
Set
|
|
Me._licenseNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxQualificator1() As String
|
|
Get
|
|
Return Me._exciseTaxQualificator1
|
|
End Get
|
|
Set
|
|
Me._exciseTaxQualificator1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxQualificator2() As String
|
|
Get
|
|
Return Me._exciseTaxQualificator2
|
|
End Get
|
|
Set
|
|
Me._exciseTaxQualificator2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxQualificator3() As String
|
|
Get
|
|
Return Me._exciseTaxQualificator3
|
|
End Get
|
|
Set
|
|
Me._exciseTaxQualificator3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxQualificator4() As String
|
|
Get
|
|
Return Me._exciseTaxQualificator4
|
|
End Get
|
|
Set
|
|
Me._exciseTaxQualificator4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxQualificator5() As String
|
|
Get
|
|
Return Me._exciseTaxQualificator5
|
|
End Get
|
|
Set
|
|
Me._exciseTaxQualificator5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxQualificator6() As String
|
|
Get
|
|
Return Me._exciseTaxQualificator6
|
|
End Get
|
|
Set
|
|
Me._exciseTaxQualificator6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property quota() As Decimal
|
|
Get
|
|
Return Me._quota
|
|
End Get
|
|
Set
|
|
Me._quota = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property quotaUom() As String
|
|
Get
|
|
Return Me._quotaUom
|
|
End Get
|
|
Set
|
|
Me._quotaUom = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property quotaQualificator() As String
|
|
Get
|
|
Return Me._quotaQualificator
|
|
End Get
|
|
Set
|
|
Me._quotaQualificator = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property location() As String
|
|
Get
|
|
Return Me._location
|
|
End Get
|
|
Set
|
|
Me._location = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property taxCode1() As Long
|
|
Get
|
|
Return Me._taxCode1
|
|
End Get
|
|
Set
|
|
Me._taxCode1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property taxCode2() As Long
|
|
Get
|
|
Return Me._taxCode2
|
|
End Get
|
|
Set
|
|
Me._taxCode2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property taxCode3() As Long
|
|
Get
|
|
Return Me._taxCode3
|
|
End Get
|
|
Set
|
|
Me._taxCode3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property taxCode4() As Long
|
|
Get
|
|
Return Me._taxCode4
|
|
End Get
|
|
Set
|
|
Me._taxCode4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property taxCode5() As Long
|
|
Get
|
|
Return Me._taxCode5
|
|
End Get
|
|
Set
|
|
Me._taxCode5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property taxCode6() As Long
|
|
Get
|
|
Return Me._taxCode6
|
|
End Get
|
|
Set
|
|
Me._taxCode6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property tobaccoFlagNumber() As String
|
|
Get
|
|
Return Me._tobaccoFlagNumber
|
|
End Get
|
|
Set
|
|
Me._tobaccoFlagNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property subjectArea() As String
|
|
Get
|
|
Return Me._subjectArea
|
|
End Get
|
|
Set
|
|
Me._subjectArea = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property completeInfoFlag() As String
|
|
Get
|
|
Return Me._completeInfoFlag
|
|
End Get
|
|
Set
|
|
Me._completeInfoFlag = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property statisticStatus() As String
|
|
Get
|
|
Return Me._statisticStatus
|
|
End Get
|
|
Set
|
|
Me._statisticStatus = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property chargeType() As String
|
|
Get
|
|
Return Me._chargeType
|
|
End Get
|
|
Set
|
|
Me._chargeType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property indirectPayment() As Long
|
|
Get
|
|
Return Me._indirectPayment
|
|
End Get
|
|
Set
|
|
Me._indirectPayment = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property indirectPaymentCurrency() As String
|
|
Get
|
|
Return Me._indirectPaymentCurrency
|
|
End Get
|
|
Set
|
|
Me._indirectPaymentCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property indirectPaymentFlag() As String
|
|
Get
|
|
Return Me._indirectPaymentFlag
|
|
End Get
|
|
Set
|
|
Me._indirectPaymentFlag = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property indirectPaymentRate() As Long
|
|
Get
|
|
Return Me._indirectPaymentRate
|
|
End Get
|
|
Set
|
|
Me._indirectPaymentRate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property messageFlag22() As String
|
|
Get
|
|
Return Me._messageFlag22
|
|
End Get
|
|
Set
|
|
Me._messageFlag22 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property messageFlag55() As String
|
|
Get
|
|
Return Me._messageFlag55
|
|
End Get
|
|
Set
|
|
Me._messageFlag55 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property messageFlag77() As String
|
|
Get
|
|
Return Me._messageFlag77
|
|
End Get
|
|
Set
|
|
Me._messageFlag77 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property messageFlag90() As String
|
|
Get
|
|
Return Me._messageFlag90
|
|
End Get
|
|
Set
|
|
Me._messageFlag90 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property tariffNumber() As String
|
|
Get
|
|
Return Me._tariffNumber
|
|
End Get
|
|
Set
|
|
Me._tariffNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property shippingCountry() As String
|
|
Get
|
|
Return Me._shippingCountry
|
|
End Get
|
|
Set
|
|
Me._shippingCountry = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property countryOfOrigin() As String
|
|
Get
|
|
Return Me._countryOfOrigin
|
|
End Get
|
|
Set
|
|
Me._countryOfOrigin = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property netWeight() As Decimal
|
|
Get
|
|
Return Me._netWeight
|
|
End Get
|
|
Set
|
|
Me._netWeight = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property partPrice() As Long
|
|
Get
|
|
Return Me._partPrice
|
|
End Get
|
|
Set
|
|
Me._partPrice = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property prefRequestCode() As String
|
|
Get
|
|
Return Me._prefRequestCode
|
|
End Get
|
|
Set
|
|
Me._prefRequestCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property positionNumber() As Long
|
|
Get
|
|
Return Me._positionNumber
|
|
End Get
|
|
Set
|
|
Me._positionNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCostsIVAT() As Decimal
|
|
Get
|
|
Return Me._additionalCostsIVAT
|
|
End Get
|
|
Set
|
|
Me._additionalCostsIVAT = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicImportLineAdditionalParams))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicImportLineAdditionalParams object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicImportLineAdditionalParams object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicImportLineAdditionalParams 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 TMicImportLineAdditionalParams, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicImportLineAdditionalParams)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicImportLineAdditionalParams) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicImportLineAdditionalParams
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicImportLineAdditionalParams)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicImportLineAdditionalParams
|
|
Return CType(SerializerXml.Deserialize(s), TMicImportLineAdditionalParams)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicImportLineAdditionalParams 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicImportLineAdditionalParams object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicImportLineAdditionalParams 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 TMicImportLineAdditionalParams, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicImportLineAdditionalParams)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicImportLineAdditionalParams) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicImportLineAdditionalParams
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicOprInfo
|
|
|
|
#Region "Private fields"
|
|
Private _dutyGroup1 As String
|
|
|
|
Private _reductionAmount1 As Decimal
|
|
|
|
Private _dutyGroup2 As String
|
|
|
|
Private _reductionAmount2 As Decimal
|
|
|
|
Private _dutyGroup3 As String
|
|
|
|
Private _reductionAmount3 As Decimal
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property dutyGroup1() As String
|
|
Get
|
|
Return Me._dutyGroup1
|
|
End Get
|
|
Set
|
|
Me._dutyGroup1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property reductionAmount1() As Decimal
|
|
Get
|
|
Return Me._reductionAmount1
|
|
End Get
|
|
Set
|
|
Me._reductionAmount1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property dutyGroup2() As String
|
|
Get
|
|
Return Me._dutyGroup2
|
|
End Get
|
|
Set
|
|
Me._dutyGroup2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property reductionAmount2() As Decimal
|
|
Get
|
|
Return Me._reductionAmount2
|
|
End Get
|
|
Set
|
|
Me._reductionAmount2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property dutyGroup3() As String
|
|
Get
|
|
Return Me._dutyGroup3
|
|
End Get
|
|
Set
|
|
Me._dutyGroup3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property reductionAmount3() As Decimal
|
|
Get
|
|
Return Me._reductionAmount3
|
|
End Get
|
|
Set
|
|
Me._reductionAmount3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicOprInfo))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicOprInfo object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicOprInfo object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicOprInfo 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 TMicOprInfo, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicOprInfo)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicOprInfo) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicOprInfo
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicOprInfo)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicOprInfo
|
|
Return CType(SerializerXml.Deserialize(s), TMicOprInfo)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicOprInfo 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicOprInfo object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicOprInfo 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 TMicOprInfo, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicOprInfo)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicOprInfo) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicOprInfo
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicDutySaving
|
|
|
|
#Region "Private fields"
|
|
Private _additionalCostsType As String
|
|
|
|
Private _code As String
|
|
|
|
Private _calculatedCustDuties As Decimal
|
|
|
|
Private _amount As Decimal
|
|
|
|
Private _creationFlag As String
|
|
|
|
Private _unitOfMeasurment As String
|
|
|
|
Private _calculationBase As Decimal
|
|
|
|
Private _countryOfDuties As String
|
|
|
|
Private _calculatedDuties As Decimal
|
|
|
|
Private _calculatedAssessmentBasis As Decimal
|
|
|
|
Private _measuresType As String
|
|
|
|
Private _dutyRate As Decimal
|
|
|
|
Private _addition As Decimal
|
|
|
|
Private _preferentialFlag As String
|
|
|
|
Private _creationUser As String
|
|
|
|
Private _creationDate As Date
|
|
|
|
Private _modificationUser As String
|
|
|
|
Private _modificationDate As Date
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property additionalCostsType() As String
|
|
Get
|
|
Return Me._additionalCostsType
|
|
End Get
|
|
Set
|
|
Me._additionalCostsType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property code() As String
|
|
Get
|
|
Return Me._code
|
|
End Get
|
|
Set
|
|
Me._code = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property calculatedCustDuties() As Decimal
|
|
Get
|
|
Return Me._calculatedCustDuties
|
|
End Get
|
|
Set
|
|
Me._calculatedCustDuties = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property amount() As Decimal
|
|
Get
|
|
Return Me._amount
|
|
End Get
|
|
Set
|
|
Me._amount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationFlag() As String
|
|
Get
|
|
Return Me._creationFlag
|
|
End Get
|
|
Set
|
|
Me._creationFlag = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property unitOfMeasurment() As String
|
|
Get
|
|
Return Me._unitOfMeasurment
|
|
End Get
|
|
Set
|
|
Me._unitOfMeasurment = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property calculationBase() As Decimal
|
|
Get
|
|
Return Me._calculationBase
|
|
End Get
|
|
Set
|
|
Me._calculationBase = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property countryOfDuties() As String
|
|
Get
|
|
Return Me._countryOfDuties
|
|
End Get
|
|
Set
|
|
Me._countryOfDuties = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property calculatedDuties() As Decimal
|
|
Get
|
|
Return Me._calculatedDuties
|
|
End Get
|
|
Set
|
|
Me._calculatedDuties = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property calculatedAssessmentBasis() As Decimal
|
|
Get
|
|
Return Me._calculatedAssessmentBasis
|
|
End Get
|
|
Set
|
|
Me._calculatedAssessmentBasis = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property measuresType() As String
|
|
Get
|
|
Return Me._measuresType
|
|
End Get
|
|
Set
|
|
Me._measuresType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property dutyRate() As Decimal
|
|
Get
|
|
Return Me._dutyRate
|
|
End Get
|
|
Set
|
|
Me._dutyRate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property addition() As Decimal
|
|
Get
|
|
Return Me._addition
|
|
End Get
|
|
Set
|
|
Me._addition = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property preferentialFlag() As String
|
|
Get
|
|
Return Me._preferentialFlag
|
|
End Get
|
|
Set
|
|
Me._preferentialFlag = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationUser() As String
|
|
Get
|
|
Return Me._creationUser
|
|
End Get
|
|
Set
|
|
Me._creationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationDate() As Date
|
|
Get
|
|
Return Me._creationDate
|
|
End Get
|
|
Set
|
|
Me._creationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationUser() As String
|
|
Get
|
|
Return Me._modificationUser
|
|
End Get
|
|
Set
|
|
Me._modificationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationDate() As Date
|
|
Get
|
|
Return Me._modificationDate
|
|
End Get
|
|
Set
|
|
Me._modificationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDutySaving))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicDutySaving object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicDutySaving object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicDutySaving 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 TMicDutySaving, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDutySaving)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicDutySaving) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicDutySaving
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDutySaving)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicDutySaving
|
|
Return CType(SerializerXml.Deserialize(s), TMicDutySaving)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicDutySaving 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicDutySaving object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicDutySaving 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 TMicDutySaving, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDutySaving)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicDutySaving) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicDutySaving
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicDutySavings
|
|
|
|
#Region "Private fields"
|
|
Private _dutySaving As List(Of TMicDutySaving)
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._dutySaving = New List(Of TMicDutySaving)()
|
|
End Sub
|
|
|
|
<XmlElement("DutySaving")>
|
|
Public Property DutySaving() As List(Of TMicDutySaving)
|
|
Get
|
|
Return Me._dutySaving
|
|
End Get
|
|
Set
|
|
Me._dutySaving = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDutySavings))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicDutySavings object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicDutySavings object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicDutySavings 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 TMicDutySavings, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDutySavings)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicDutySavings) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicDutySavings
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDutySavings)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicDutySavings
|
|
Return CType(SerializerXml.Deserialize(s), TMicDutySavings)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicDutySavings 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicDutySavings object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicDutySavings 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 TMicDutySavings, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDutySavings)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicDutySavings) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicDutySavings
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicDutyTax
|
|
|
|
#Region "Private fields"
|
|
Private _additionalCostsType As String
|
|
|
|
Private _code As String
|
|
|
|
Private _calculatedCustDuties As Decimal
|
|
|
|
Private _amount As Decimal
|
|
|
|
Private _creationFlag As String
|
|
|
|
Private _unitOfMeasurment As String
|
|
|
|
Private _calculationBase As Decimal
|
|
|
|
Private _countryOfDuties As String
|
|
|
|
Private _calculatedDuties As Decimal
|
|
|
|
Private _calculatedAssessmentBasis As Decimal
|
|
|
|
Private _areaCode As String
|
|
|
|
Private _measuresType As String
|
|
|
|
Private _dutyCodeCustomsOffice As String
|
|
|
|
Private _indentureNumber As String
|
|
|
|
Private _dutyRate As Decimal
|
|
|
|
Private _stornoFlag As String
|
|
|
|
Private _dutyAmountIncreaseOrDecrease As Decimal
|
|
|
|
Private _typeOfAdditionalCode As String
|
|
|
|
Private _noOfAdditionalCode As String
|
|
|
|
Private _calculatedDutyRate As Decimal
|
|
|
|
Private _creationUser As String
|
|
|
|
Private _creationDate As Date
|
|
|
|
Private _modificationUser As String
|
|
|
|
Private _modificationDate As Date
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property additionalCostsType() As String
|
|
Get
|
|
Return Me._additionalCostsType
|
|
End Get
|
|
Set
|
|
Me._additionalCostsType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property code() As String
|
|
Get
|
|
Return Me._code
|
|
End Get
|
|
Set
|
|
Me._code = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property calculatedCustDuties() As Decimal
|
|
Get
|
|
Return Me._calculatedCustDuties
|
|
End Get
|
|
Set
|
|
Me._calculatedCustDuties = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property amount() As Decimal
|
|
Get
|
|
Return Me._amount
|
|
End Get
|
|
Set
|
|
Me._amount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationFlag() As String
|
|
Get
|
|
Return Me._creationFlag
|
|
End Get
|
|
Set
|
|
Me._creationFlag = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property unitOfMeasurment() As String
|
|
Get
|
|
Return Me._unitOfMeasurment
|
|
End Get
|
|
Set
|
|
Me._unitOfMeasurment = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property calculationBase() As Decimal
|
|
Get
|
|
Return Me._calculationBase
|
|
End Get
|
|
Set
|
|
Me._calculationBase = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property countryOfDuties() As String
|
|
Get
|
|
Return Me._countryOfDuties
|
|
End Get
|
|
Set
|
|
Me._countryOfDuties = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property calculatedDuties() As Decimal
|
|
Get
|
|
Return Me._calculatedDuties
|
|
End Get
|
|
Set
|
|
Me._calculatedDuties = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property calculatedAssessmentBasis() As Decimal
|
|
Get
|
|
Return Me._calculatedAssessmentBasis
|
|
End Get
|
|
Set
|
|
Me._calculatedAssessmentBasis = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property areaCode() As String
|
|
Get
|
|
Return Me._areaCode
|
|
End Get
|
|
Set
|
|
Me._areaCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property measuresType() As String
|
|
Get
|
|
Return Me._measuresType
|
|
End Get
|
|
Set
|
|
Me._measuresType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property dutyCodeCustomsOffice() As String
|
|
Get
|
|
Return Me._dutyCodeCustomsOffice
|
|
End Get
|
|
Set
|
|
Me._dutyCodeCustomsOffice = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property indentureNumber() As String
|
|
Get
|
|
Return Me._indentureNumber
|
|
End Get
|
|
Set
|
|
Me._indentureNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property dutyRate() As Decimal
|
|
Get
|
|
Return Me._dutyRate
|
|
End Get
|
|
Set
|
|
Me._dutyRate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property stornoFlag() As String
|
|
Get
|
|
Return Me._stornoFlag
|
|
End Get
|
|
Set
|
|
Me._stornoFlag = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property dutyAmountIncreaseOrDecrease() As Decimal
|
|
Get
|
|
Return Me._dutyAmountIncreaseOrDecrease
|
|
End Get
|
|
Set
|
|
Me._dutyAmountIncreaseOrDecrease = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property typeOfAdditionalCode() As String
|
|
Get
|
|
Return Me._typeOfAdditionalCode
|
|
End Get
|
|
Set
|
|
Me._typeOfAdditionalCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property noOfAdditionalCode() As String
|
|
Get
|
|
Return Me._noOfAdditionalCode
|
|
End Get
|
|
Set
|
|
Me._noOfAdditionalCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property calculatedDutyRate() As Decimal
|
|
Get
|
|
Return Me._calculatedDutyRate
|
|
End Get
|
|
Set
|
|
Me._calculatedDutyRate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationUser() As String
|
|
Get
|
|
Return Me._creationUser
|
|
End Get
|
|
Set
|
|
Me._creationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationDate() As Date
|
|
Get
|
|
Return Me._creationDate
|
|
End Get
|
|
Set
|
|
Me._creationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationUser() As String
|
|
Get
|
|
Return Me._modificationUser
|
|
End Get
|
|
Set
|
|
Me._modificationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationDate() As Date
|
|
Get
|
|
Return Me._modificationDate
|
|
End Get
|
|
Set
|
|
Me._modificationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDutyTax))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicDutyTax object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicDutyTax object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicDutyTax 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 TMicDutyTax, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDutyTax)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicDutyTax) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicDutyTax
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDutyTax)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicDutyTax
|
|
Return CType(SerializerXml.Deserialize(s), TMicDutyTax)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicDutyTax 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicDutyTax object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicDutyTax 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 TMicDutyTax, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDutyTax)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicDutyTax) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicDutyTax
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicDutyTaxes
|
|
|
|
#Region "Private fields"
|
|
Private _dutyTax As List(Of TMicDutyTax)
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._dutyTax = New List(Of TMicDutyTax)()
|
|
End Sub
|
|
|
|
<XmlElement("DutyTax")>
|
|
Public Property DutyTax() As List(Of TMicDutyTax)
|
|
Get
|
|
Return Me._dutyTax
|
|
End Get
|
|
Set
|
|
Me._dutyTax = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDutyTaxes))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicDutyTaxes object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicDutyTaxes object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicDutyTaxes 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 TMicDutyTaxes, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDutyTaxes)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicDutyTaxes) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicDutyTaxes
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDutyTaxes)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicDutyTaxes
|
|
Return CType(SerializerXml.Deserialize(s), TMicDutyTaxes)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicDutyTaxes 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicDutyTaxes object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicDutyTaxes 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 TMicDutyTaxes, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDutyTaxes)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicDutyTaxes) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicDutyTaxes
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicDuty
|
|
|
|
#Region "Private fields"
|
|
Private _type As String
|
|
|
|
Private _calcDutyBase As Decimal
|
|
|
|
Private _currency As String
|
|
|
|
Private _code As String
|
|
|
|
Private _rate As Decimal
|
|
|
|
Private _amount As Decimal
|
|
|
|
Private _addDeduct As Decimal
|
|
|
|
Private _calcDuty As Decimal
|
|
|
|
Private _duty As Decimal
|
|
|
|
Private _dutyBase As Decimal
|
|
|
|
Private _measureCode As String
|
|
|
|
Private _measure As String
|
|
|
|
Private _authorityDutyCode As String
|
|
|
|
Private _territory As String
|
|
|
|
Private _typeAddCode As String
|
|
|
|
Private _numberAddCode As String
|
|
|
|
Private _tariffRateQuota As String
|
|
|
|
Private _creationUser As String
|
|
|
|
Private _creationDate As Date
|
|
|
|
Private _modificationUser As String
|
|
|
|
Private _modificationDate As Date
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property type() As String
|
|
Get
|
|
Return Me._type
|
|
End Get
|
|
Set
|
|
Me._type = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property calcDutyBase() As Decimal
|
|
Get
|
|
Return Me._calcDutyBase
|
|
End Get
|
|
Set
|
|
Me._calcDutyBase = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property currency() As String
|
|
Get
|
|
Return Me._currency
|
|
End Get
|
|
Set
|
|
Me._currency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property code() As String
|
|
Get
|
|
Return Me._code
|
|
End Get
|
|
Set
|
|
Me._code = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property rate() As Decimal
|
|
Get
|
|
Return Me._rate
|
|
End Get
|
|
Set
|
|
Me._rate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property amount() As Decimal
|
|
Get
|
|
Return Me._amount
|
|
End Get
|
|
Set
|
|
Me._amount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property addDeduct() As Decimal
|
|
Get
|
|
Return Me._addDeduct
|
|
End Get
|
|
Set
|
|
Me._addDeduct = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property calcDuty() As Decimal
|
|
Get
|
|
Return Me._calcDuty
|
|
End Get
|
|
Set
|
|
Me._calcDuty = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property duty() As Decimal
|
|
Get
|
|
Return Me._duty
|
|
End Get
|
|
Set
|
|
Me._duty = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property dutyBase() As Decimal
|
|
Get
|
|
Return Me._dutyBase
|
|
End Get
|
|
Set
|
|
Me._dutyBase = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property measureCode() As String
|
|
Get
|
|
Return Me._measureCode
|
|
End Get
|
|
Set
|
|
Me._measureCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property measure() As String
|
|
Get
|
|
Return Me._measure
|
|
End Get
|
|
Set
|
|
Me._measure = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property authorityDutyCode() As String
|
|
Get
|
|
Return Me._authorityDutyCode
|
|
End Get
|
|
Set
|
|
Me._authorityDutyCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property territory() As String
|
|
Get
|
|
Return Me._territory
|
|
End Get
|
|
Set
|
|
Me._territory = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property typeAddCode() As String
|
|
Get
|
|
Return Me._typeAddCode
|
|
End Get
|
|
Set
|
|
Me._typeAddCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property numberAddCode() As String
|
|
Get
|
|
Return Me._numberAddCode
|
|
End Get
|
|
Set
|
|
Me._numberAddCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property tariffRateQuota() As String
|
|
Get
|
|
Return Me._tariffRateQuota
|
|
End Get
|
|
Set
|
|
Me._tariffRateQuota = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationUser() As String
|
|
Get
|
|
Return Me._creationUser
|
|
End Get
|
|
Set
|
|
Me._creationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationDate() As Date
|
|
Get
|
|
Return Me._creationDate
|
|
End Get
|
|
Set
|
|
Me._creationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationUser() As String
|
|
Get
|
|
Return Me._modificationUser
|
|
End Get
|
|
Set
|
|
Me._modificationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationDate() As Date
|
|
Get
|
|
Return Me._modificationDate
|
|
End Get
|
|
Set
|
|
Me._modificationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDuty))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicDuty object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicDuty object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicDuty 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 TMicDuty, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDuty)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicDuty) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicDuty
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDuty)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicDuty
|
|
Return CType(SerializerXml.Deserialize(s), TMicDuty)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicDuty 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicDuty object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicDuty 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 TMicDuty, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDuty)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicDuty) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicDuty
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicDuties
|
|
|
|
#Region "Private fields"
|
|
Private _duty As List(Of TMicDuty)
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._duty = New List(Of TMicDuty)()
|
|
End Sub
|
|
|
|
<XmlElement("Duty")>
|
|
Public Property Duty() As List(Of TMicDuty)
|
|
Get
|
|
Return Me._duty
|
|
End Get
|
|
Set
|
|
Me._duty = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDuties))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicDuties object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicDuties object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicDuties 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 TMicDuties, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDuties)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicDuties) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicDuties
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDuties)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicDuties
|
|
Return CType(SerializerXml.Deserialize(s), TMicDuties)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicDuties 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicDuties object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicDuties 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 TMicDuties, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDuties)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicDuties) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicDuties
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicCalculatedValuesCust
|
|
|
|
#Region "Private fields"
|
|
Private _customsValue As Decimal
|
|
|
|
Private _netValue As Decimal
|
|
|
|
Private _additionalStatisticalValue As Decimal
|
|
|
|
Private _additionalCostsVat As Decimal
|
|
|
|
Private _addStatisticValue As Decimal
|
|
|
|
Private _freightCostsCommunity As Decimal
|
|
|
|
Private _freightCostsInternational As Decimal
|
|
|
|
Private _oprIngredientsValue As Decimal
|
|
|
|
Private _additionalCosts1 As Decimal
|
|
|
|
Private _additionalCosts2 As Decimal
|
|
|
|
Private _additionalCosts3 As Decimal
|
|
|
|
Private _additionalCosts4 As Decimal
|
|
|
|
Private _additionalCosts5 As Decimal
|
|
|
|
Private _additionalCosts6 As Decimal
|
|
|
|
Private _additionalCosts7 As Decimal
|
|
|
|
Private _additionalCosts8 As Decimal
|
|
|
|
Private _additionalCosts9 As Decimal
|
|
|
|
Private _additionalCosts10 As Decimal
|
|
|
|
Private _additionalCosts11 As Decimal
|
|
|
|
Private _additionalCosts12 As Decimal
|
|
|
|
Private _additionalCosts13 As Decimal
|
|
|
|
Private _additionalCosts14 As Decimal
|
|
|
|
Private _additionalCosts15 As Decimal
|
|
|
|
Private _additionalCosts16 As Decimal
|
|
|
|
Private _additionalCosts17 As Decimal
|
|
|
|
Private _additionalCosts18 As Decimal
|
|
|
|
Private _additionalCosts19 As Decimal
|
|
|
|
Private _additionalCosts20 As Decimal
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property customsValue() As Decimal
|
|
Get
|
|
Return Me._customsValue
|
|
End Get
|
|
Set
|
|
Me._customsValue = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property netValue() As Decimal
|
|
Get
|
|
Return Me._netValue
|
|
End Get
|
|
Set
|
|
Me._netValue = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalStatisticalValue() As Decimal
|
|
Get
|
|
Return Me._additionalStatisticalValue
|
|
End Get
|
|
Set
|
|
Me._additionalStatisticalValue = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCostsVat() As Decimal
|
|
Get
|
|
Return Me._additionalCostsVat
|
|
End Get
|
|
Set
|
|
Me._additionalCostsVat = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property addStatisticValue() As Decimal
|
|
Get
|
|
Return Me._addStatisticValue
|
|
End Get
|
|
Set
|
|
Me._addStatisticValue = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property freightCostsCommunity() As Decimal
|
|
Get
|
|
Return Me._freightCostsCommunity
|
|
End Get
|
|
Set
|
|
Me._freightCostsCommunity = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property freightCostsInternational() As Decimal
|
|
Get
|
|
Return Me._freightCostsInternational
|
|
End Get
|
|
Set
|
|
Me._freightCostsInternational = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property oprIngredientsValue() As Decimal
|
|
Get
|
|
Return Me._oprIngredientsValue
|
|
End Get
|
|
Set
|
|
Me._oprIngredientsValue = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCosts1() As Decimal
|
|
Get
|
|
Return Me._additionalCosts1
|
|
End Get
|
|
Set
|
|
Me._additionalCosts1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCosts2() As Decimal
|
|
Get
|
|
Return Me._additionalCosts2
|
|
End Get
|
|
Set
|
|
Me._additionalCosts2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCosts3() As Decimal
|
|
Get
|
|
Return Me._additionalCosts3
|
|
End Get
|
|
Set
|
|
Me._additionalCosts3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCosts4() As Decimal
|
|
Get
|
|
Return Me._additionalCosts4
|
|
End Get
|
|
Set
|
|
Me._additionalCosts4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCosts5() As Decimal
|
|
Get
|
|
Return Me._additionalCosts5
|
|
End Get
|
|
Set
|
|
Me._additionalCosts5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCosts6() As Decimal
|
|
Get
|
|
Return Me._additionalCosts6
|
|
End Get
|
|
Set
|
|
Me._additionalCosts6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCosts7() As Decimal
|
|
Get
|
|
Return Me._additionalCosts7
|
|
End Get
|
|
Set
|
|
Me._additionalCosts7 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCosts8() As Decimal
|
|
Get
|
|
Return Me._additionalCosts8
|
|
End Get
|
|
Set
|
|
Me._additionalCosts8 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCosts9() As Decimal
|
|
Get
|
|
Return Me._additionalCosts9
|
|
End Get
|
|
Set
|
|
Me._additionalCosts9 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCosts10() As Decimal
|
|
Get
|
|
Return Me._additionalCosts10
|
|
End Get
|
|
Set
|
|
Me._additionalCosts10 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCosts11() As Decimal
|
|
Get
|
|
Return Me._additionalCosts11
|
|
End Get
|
|
Set
|
|
Me._additionalCosts11 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCosts12() As Decimal
|
|
Get
|
|
Return Me._additionalCosts12
|
|
End Get
|
|
Set
|
|
Me._additionalCosts12 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCosts13() As Decimal
|
|
Get
|
|
Return Me._additionalCosts13
|
|
End Get
|
|
Set
|
|
Me._additionalCosts13 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCosts14() As Decimal
|
|
Get
|
|
Return Me._additionalCosts14
|
|
End Get
|
|
Set
|
|
Me._additionalCosts14 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCosts15() As Decimal
|
|
Get
|
|
Return Me._additionalCosts15
|
|
End Get
|
|
Set
|
|
Me._additionalCosts15 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCosts16() As Decimal
|
|
Get
|
|
Return Me._additionalCosts16
|
|
End Get
|
|
Set
|
|
Me._additionalCosts16 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCosts17() As Decimal
|
|
Get
|
|
Return Me._additionalCosts17
|
|
End Get
|
|
Set
|
|
Me._additionalCosts17 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCosts18() As Decimal
|
|
Get
|
|
Return Me._additionalCosts18
|
|
End Get
|
|
Set
|
|
Me._additionalCosts18 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCosts19() As Decimal
|
|
Get
|
|
Return Me._additionalCosts19
|
|
End Get
|
|
Set
|
|
Me._additionalCosts19 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCosts20() As Decimal
|
|
Get
|
|
Return Me._additionalCosts20
|
|
End Get
|
|
Set
|
|
Me._additionalCosts20 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicCalculatedValuesCust))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicCalculatedValuesCust object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicCalculatedValuesCust object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicCalculatedValuesCust 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 TMicCalculatedValuesCust, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicCalculatedValuesCust)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicCalculatedValuesCust) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicCalculatedValuesCust
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicCalculatedValuesCust)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicCalculatedValuesCust
|
|
Return CType(SerializerXml.Deserialize(s), TMicCalculatedValuesCust)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicCalculatedValuesCust 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicCalculatedValuesCust object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicCalculatedValuesCust 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 TMicCalculatedValuesCust, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicCalculatedValuesCust)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicCalculatedValuesCust) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicCalculatedValuesCust
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicCalculatedValues
|
|
|
|
#Region "Private fields"
|
|
Private _customsValue As Decimal
|
|
|
|
Private _netValue As Decimal
|
|
|
|
Private _statValue As Decimal
|
|
|
|
Private _freightStatVal As Decimal
|
|
|
|
Private _freightInternational As Decimal
|
|
|
|
Private _freightEU As Decimal
|
|
|
|
Private _freightNational As Decimal
|
|
|
|
Private _insurance As Decimal
|
|
|
|
Private _shipAddCosts As List(Of Decimal)
|
|
|
|
Private _invAddCosts As List(Of Decimal)
|
|
|
|
Private _lineAddCosts As List(Of Decimal)
|
|
|
|
Private _custValue As Decimal
|
|
|
|
Private _assistValue As Decimal
|
|
|
|
Private _vatAddCosts As Decimal
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._lineAddCosts = New List(Of Decimal)()
|
|
Me._invAddCosts = New List(Of Decimal)()
|
|
Me._shipAddCosts = New List(Of Decimal)()
|
|
End Sub
|
|
|
|
Public Property customsValue() As Decimal
|
|
Get
|
|
Return Me._customsValue
|
|
End Get
|
|
Set
|
|
Me._customsValue = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property netValue() As Decimal
|
|
Get
|
|
Return Me._netValue
|
|
End Get
|
|
Set
|
|
Me._netValue = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property statValue() As Decimal
|
|
Get
|
|
Return Me._statValue
|
|
End Get
|
|
Set
|
|
Me._statValue = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property freightStatVal() As Decimal
|
|
Get
|
|
Return Me._freightStatVal
|
|
End Get
|
|
Set
|
|
Me._freightStatVal = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property freightInternational() As Decimal
|
|
Get
|
|
Return Me._freightInternational
|
|
End Get
|
|
Set
|
|
Me._freightInternational = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property freightEU() As Decimal
|
|
Get
|
|
Return Me._freightEU
|
|
End Get
|
|
Set
|
|
Me._freightEU = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property freightNational() As Decimal
|
|
Get
|
|
Return Me._freightNational
|
|
End Get
|
|
Set
|
|
Me._freightNational = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property insurance() As Decimal
|
|
Get
|
|
Return Me._insurance
|
|
End Get
|
|
Set
|
|
Me._insurance = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("shipAddCosts")>
|
|
Public Property shipAddCosts() As List(Of Decimal)
|
|
Get
|
|
Return Me._shipAddCosts
|
|
End Get
|
|
Set
|
|
Me._shipAddCosts = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("invAddCosts")>
|
|
Public Property invAddCosts() As List(Of Decimal)
|
|
Get
|
|
Return Me._invAddCosts
|
|
End Get
|
|
Set
|
|
Me._invAddCosts = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("lineAddCosts")>
|
|
Public Property lineAddCosts() As List(Of Decimal)
|
|
Get
|
|
Return Me._lineAddCosts
|
|
End Get
|
|
Set
|
|
Me._lineAddCosts = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property custValue() As Decimal
|
|
Get
|
|
Return Me._custValue
|
|
End Get
|
|
Set
|
|
Me._custValue = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property assistValue() As Decimal
|
|
Get
|
|
Return Me._assistValue
|
|
End Get
|
|
Set
|
|
Me._assistValue = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property vatAddCosts() As Decimal
|
|
Get
|
|
Return Me._vatAddCosts
|
|
End Get
|
|
Set
|
|
Me._vatAddCosts = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicCalculatedValues))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicCalculatedValues object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicCalculatedValues object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicCalculatedValues 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 TMicCalculatedValues, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicCalculatedValues)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicCalculatedValues) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicCalculatedValues
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicCalculatedValues)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicCalculatedValues
|
|
Return CType(SerializerXml.Deserialize(s), TMicCalculatedValues)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicCalculatedValues 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicCalculatedValues object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicCalculatedValues 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 TMicCalculatedValues, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicCalculatedValues)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicCalculatedValues) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicCalculatedValues
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicDetailContainerInfo
|
|
|
|
#Region "Private fields"
|
|
Private _containerNumber As String
|
|
|
|
Private _containerSealNumber As String
|
|
|
|
Private _containerPackages As Decimal
|
|
|
|
Private _containerGrossWeight As Decimal
|
|
|
|
Private _containerNetWeight As Decimal
|
|
|
|
Private _creationUser As String
|
|
|
|
Private _creationDate As Date
|
|
|
|
Private _modificationUser As String
|
|
|
|
Private _modificationDate As Date
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property containerNumber() As String
|
|
Get
|
|
Return Me._containerNumber
|
|
End Get
|
|
Set
|
|
Me._containerNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property containerSealNumber() As String
|
|
Get
|
|
Return Me._containerSealNumber
|
|
End Get
|
|
Set
|
|
Me._containerSealNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property containerPackages() As Decimal
|
|
Get
|
|
Return Me._containerPackages
|
|
End Get
|
|
Set
|
|
Me._containerPackages = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property containerGrossWeight() As Decimal
|
|
Get
|
|
Return Me._containerGrossWeight
|
|
End Get
|
|
Set
|
|
Me._containerGrossWeight = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property containerNetWeight() As Decimal
|
|
Get
|
|
Return Me._containerNetWeight
|
|
End Get
|
|
Set
|
|
Me._containerNetWeight = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationUser() As String
|
|
Get
|
|
Return Me._creationUser
|
|
End Get
|
|
Set
|
|
Me._creationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationDate() As Date
|
|
Get
|
|
Return Me._creationDate
|
|
End Get
|
|
Set
|
|
Me._creationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationUser() As String
|
|
Get
|
|
Return Me._modificationUser
|
|
End Get
|
|
Set
|
|
Me._modificationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationDate() As Date
|
|
Get
|
|
Return Me._modificationDate
|
|
End Get
|
|
Set
|
|
Me._modificationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDetailContainerInfo))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicDetailContainerInfo object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicDetailContainerInfo object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicDetailContainerInfo 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 TMicDetailContainerInfo, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDetailContainerInfo)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicDetailContainerInfo) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicDetailContainerInfo
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDetailContainerInfo)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicDetailContainerInfo
|
|
Return CType(SerializerXml.Deserialize(s), TMicDetailContainerInfo)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicDetailContainerInfo 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicDetailContainerInfo object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicDetailContainerInfo 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 TMicDetailContainerInfo, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDetailContainerInfo)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicDetailContainerInfo) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicDetailContainerInfo
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicContainerInfo
|
|
|
|
#Region "Private fields"
|
|
Private _detailContainerInfo As List(Of TMicDetailContainerInfo)
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._detailContainerInfo = New List(Of TMicDetailContainerInfo)()
|
|
End Sub
|
|
|
|
<XmlElement("DetailContainerInfo")>
|
|
Public Property DetailContainerInfo() As List(Of TMicDetailContainerInfo)
|
|
Get
|
|
Return Me._detailContainerInfo
|
|
End Get
|
|
Set
|
|
Me._detailContainerInfo = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicContainerInfo))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicContainerInfo object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicContainerInfo object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicContainerInfo 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 TMicContainerInfo, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicContainerInfo)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicContainerInfo) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicContainerInfo
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicContainerInfo)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicContainerInfo
|
|
Return CType(SerializerXml.Deserialize(s), TMicContainerInfo)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicContainerInfo 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicContainerInfo object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicContainerInfo 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 TMicContainerInfo, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicContainerInfo)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicContainerInfo) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicContainerInfo
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicLinesCustomerFields
|
|
|
|
#Region "Private fields"
|
|
Private _text1 As String
|
|
|
|
Private _text2 As String
|
|
|
|
Private _text3 As String
|
|
|
|
Private _text4 As String
|
|
|
|
Private _text5 As String
|
|
|
|
Private _text6 As String
|
|
|
|
Private _text7 As String
|
|
|
|
Private _text8 As String
|
|
|
|
Private _text9 As String
|
|
|
|
Private _text10 As String
|
|
|
|
Private _text11 As String
|
|
|
|
Private _text12 As String
|
|
|
|
Private _text13 As String
|
|
|
|
Private _text14 As String
|
|
|
|
Private _text15 As String
|
|
|
|
Private _date1 As Date
|
|
|
|
Private _date2 As Date
|
|
|
|
Private _date3 As Date
|
|
|
|
Private _date4 As Date
|
|
|
|
Private _date5 As Date
|
|
|
|
Private _date6 As Date
|
|
|
|
Private _date7 As Date
|
|
|
|
Private _date8 As Date
|
|
|
|
Private _date9 As Date
|
|
|
|
Private _date10 As Date
|
|
|
|
Private _date11 As Date
|
|
|
|
Private _date12 As Date
|
|
|
|
Private _date13 As Date
|
|
|
|
Private _date14 As Date
|
|
|
|
Private _date15 As Date
|
|
|
|
Private _flag1 As Boolean
|
|
|
|
Private _flag2 As Boolean
|
|
|
|
Private _flag3 As Boolean
|
|
|
|
Private _flag4 As Boolean
|
|
|
|
Private _flag5 As Boolean
|
|
|
|
Private _flag6 As Boolean
|
|
|
|
Private _flag7 As Boolean
|
|
|
|
Private _flag8 As Boolean
|
|
|
|
Private _flag9 As Boolean
|
|
|
|
Private _flag10 As Boolean
|
|
|
|
Private _flag11 As Boolean
|
|
|
|
Private _flag12 As Boolean
|
|
|
|
Private _flag13 As Boolean
|
|
|
|
Private _flag14 As Boolean
|
|
|
|
Private _flag15 As Boolean
|
|
|
|
Private _number1 As Decimal
|
|
|
|
Private _number2 As Decimal
|
|
|
|
Private _number3 As Decimal
|
|
|
|
Private _number4 As Decimal
|
|
|
|
Private _number5 As Decimal
|
|
|
|
Private _number6 As Decimal
|
|
|
|
Private _number7 As Decimal
|
|
|
|
Private _number8 As Decimal
|
|
|
|
Private _number9 As Decimal
|
|
|
|
Private _number10 As Decimal
|
|
|
|
Private _number11 As Decimal
|
|
|
|
Private _number12 As Decimal
|
|
|
|
Private _number13 As Decimal
|
|
|
|
Private _number14 As Decimal
|
|
|
|
Private _number15 As Decimal
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property text1() As String
|
|
Get
|
|
Return Me._text1
|
|
End Get
|
|
Set
|
|
Me._text1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text2() As String
|
|
Get
|
|
Return Me._text2
|
|
End Get
|
|
Set
|
|
Me._text2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text3() As String
|
|
Get
|
|
Return Me._text3
|
|
End Get
|
|
Set
|
|
Me._text3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text4() As String
|
|
Get
|
|
Return Me._text4
|
|
End Get
|
|
Set
|
|
Me._text4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text5() As String
|
|
Get
|
|
Return Me._text5
|
|
End Get
|
|
Set
|
|
Me._text5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text6() As String
|
|
Get
|
|
Return Me._text6
|
|
End Get
|
|
Set
|
|
Me._text6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text7() As String
|
|
Get
|
|
Return Me._text7
|
|
End Get
|
|
Set
|
|
Me._text7 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text8() As String
|
|
Get
|
|
Return Me._text8
|
|
End Get
|
|
Set
|
|
Me._text8 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text9() As String
|
|
Get
|
|
Return Me._text9
|
|
End Get
|
|
Set
|
|
Me._text9 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text10() As String
|
|
Get
|
|
Return Me._text10
|
|
End Get
|
|
Set
|
|
Me._text10 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text11() As String
|
|
Get
|
|
Return Me._text11
|
|
End Get
|
|
Set
|
|
Me._text11 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text12() As String
|
|
Get
|
|
Return Me._text12
|
|
End Get
|
|
Set
|
|
Me._text12 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text13() As String
|
|
Get
|
|
Return Me._text13
|
|
End Get
|
|
Set
|
|
Me._text13 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text14() As String
|
|
Get
|
|
Return Me._text14
|
|
End Get
|
|
Set
|
|
Me._text14 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text15() As String
|
|
Get
|
|
Return Me._text15
|
|
End Get
|
|
Set
|
|
Me._text15 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date1() As Date
|
|
Get
|
|
Return Me._date1
|
|
End Get
|
|
Set
|
|
Me._date1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date2() As Date
|
|
Get
|
|
Return Me._date2
|
|
End Get
|
|
Set
|
|
Me._date2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date3() As Date
|
|
Get
|
|
Return Me._date3
|
|
End Get
|
|
Set
|
|
Me._date3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date4() As Date
|
|
Get
|
|
Return Me._date4
|
|
End Get
|
|
Set
|
|
Me._date4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date5() As Date
|
|
Get
|
|
Return Me._date5
|
|
End Get
|
|
Set
|
|
Me._date5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date6() As Date
|
|
Get
|
|
Return Me._date6
|
|
End Get
|
|
Set
|
|
Me._date6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date7() As Date
|
|
Get
|
|
Return Me._date7
|
|
End Get
|
|
Set
|
|
Me._date7 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date8() As Date
|
|
Get
|
|
Return Me._date8
|
|
End Get
|
|
Set
|
|
Me._date8 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date9() As Date
|
|
Get
|
|
Return Me._date9
|
|
End Get
|
|
Set
|
|
Me._date9 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date10() As Date
|
|
Get
|
|
Return Me._date10
|
|
End Get
|
|
Set
|
|
Me._date10 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date11() As Date
|
|
Get
|
|
Return Me._date11
|
|
End Get
|
|
Set
|
|
Me._date11 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date12() As Date
|
|
Get
|
|
Return Me._date12
|
|
End Get
|
|
Set
|
|
Me._date12 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date13() As Date
|
|
Get
|
|
Return Me._date13
|
|
End Get
|
|
Set
|
|
Me._date13 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date14() As Date
|
|
Get
|
|
Return Me._date14
|
|
End Get
|
|
Set
|
|
Me._date14 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date15() As Date
|
|
Get
|
|
Return Me._date15
|
|
End Get
|
|
Set
|
|
Me._date15 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag1() As Boolean
|
|
Get
|
|
Return Me._flag1
|
|
End Get
|
|
Set
|
|
Me._flag1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag2() As Boolean
|
|
Get
|
|
Return Me._flag2
|
|
End Get
|
|
Set
|
|
Me._flag2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag3() As Boolean
|
|
Get
|
|
Return Me._flag3
|
|
End Get
|
|
Set
|
|
Me._flag3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag4() As Boolean
|
|
Get
|
|
Return Me._flag4
|
|
End Get
|
|
Set
|
|
Me._flag4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag5() As Boolean
|
|
Get
|
|
Return Me._flag5
|
|
End Get
|
|
Set
|
|
Me._flag5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag6() As Boolean
|
|
Get
|
|
Return Me._flag6
|
|
End Get
|
|
Set
|
|
Me._flag6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag7() As Boolean
|
|
Get
|
|
Return Me._flag7
|
|
End Get
|
|
Set
|
|
Me._flag7 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag8() As Boolean
|
|
Get
|
|
Return Me._flag8
|
|
End Get
|
|
Set
|
|
Me._flag8 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag9() As Boolean
|
|
Get
|
|
Return Me._flag9
|
|
End Get
|
|
Set
|
|
Me._flag9 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag10() As Boolean
|
|
Get
|
|
Return Me._flag10
|
|
End Get
|
|
Set
|
|
Me._flag10 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag11() As Boolean
|
|
Get
|
|
Return Me._flag11
|
|
End Get
|
|
Set
|
|
Me._flag11 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag12() As Boolean
|
|
Get
|
|
Return Me._flag12
|
|
End Get
|
|
Set
|
|
Me._flag12 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag13() As Boolean
|
|
Get
|
|
Return Me._flag13
|
|
End Get
|
|
Set
|
|
Me._flag13 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag14() As Boolean
|
|
Get
|
|
Return Me._flag14
|
|
End Get
|
|
Set
|
|
Me._flag14 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag15() As Boolean
|
|
Get
|
|
Return Me._flag15
|
|
End Get
|
|
Set
|
|
Me._flag15 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number1() As Decimal
|
|
Get
|
|
Return Me._number1
|
|
End Get
|
|
Set
|
|
Me._number1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number2() As Decimal
|
|
Get
|
|
Return Me._number2
|
|
End Get
|
|
Set
|
|
Me._number2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number3() As Decimal
|
|
Get
|
|
Return Me._number3
|
|
End Get
|
|
Set
|
|
Me._number3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number4() As Decimal
|
|
Get
|
|
Return Me._number4
|
|
End Get
|
|
Set
|
|
Me._number4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number5() As Decimal
|
|
Get
|
|
Return Me._number5
|
|
End Get
|
|
Set
|
|
Me._number5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number6() As Decimal
|
|
Get
|
|
Return Me._number6
|
|
End Get
|
|
Set
|
|
Me._number6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number7() As Decimal
|
|
Get
|
|
Return Me._number7
|
|
End Get
|
|
Set
|
|
Me._number7 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number8() As Decimal
|
|
Get
|
|
Return Me._number8
|
|
End Get
|
|
Set
|
|
Me._number8 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number9() As Decimal
|
|
Get
|
|
Return Me._number9
|
|
End Get
|
|
Set
|
|
Me._number9 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number10() As Decimal
|
|
Get
|
|
Return Me._number10
|
|
End Get
|
|
Set
|
|
Me._number10 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number11() As Decimal
|
|
Get
|
|
Return Me._number11
|
|
End Get
|
|
Set
|
|
Me._number11 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number12() As Decimal
|
|
Get
|
|
Return Me._number12
|
|
End Get
|
|
Set
|
|
Me._number12 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number13() As Decimal
|
|
Get
|
|
Return Me._number13
|
|
End Get
|
|
Set
|
|
Me._number13 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number14() As Decimal
|
|
Get
|
|
Return Me._number14
|
|
End Get
|
|
Set
|
|
Me._number14 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number15() As Decimal
|
|
Get
|
|
Return Me._number15
|
|
End Get
|
|
Set
|
|
Me._number15 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicLinesCustomerFields))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicLinesCustomerFields object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicLinesCustomerFields object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicLinesCustomerFields 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 TMicLinesCustomerFields, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicLinesCustomerFields)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicLinesCustomerFields) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicLinesCustomerFields
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicLinesCustomerFields)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicLinesCustomerFields
|
|
Return CType(SerializerXml.Deserialize(s), TMicLinesCustomerFields)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicLinesCustomerFields 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicLinesCustomerFields object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicLinesCustomerFields 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 TMicLinesCustomerFields, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicLinesCustomerFields)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicLinesCustomerFields) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicLinesCustomerFields
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicImportRegistrationNo
|
|
|
|
#Region "Private fields"
|
|
Private _registrationNumber1 As String
|
|
|
|
Private _registrationNumber2 As String
|
|
|
|
Private _registrationNumber3 As String
|
|
|
|
Private _registrationNumber4 As String
|
|
|
|
Private _registrationNumberOld As String
|
|
|
|
Private _registrationNumber2Old As String
|
|
|
|
Private _messageRefNumber1 As String
|
|
|
|
Private _messageRefNumber2 As String
|
|
|
|
Private _messageRefNumber3 As String
|
|
|
|
Private _positionNumber1 As Decimal
|
|
|
|
Private _positionNumber2 As Decimal
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property registrationNumber1() As String
|
|
Get
|
|
Return Me._registrationNumber1
|
|
End Get
|
|
Set
|
|
Me._registrationNumber1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property registrationNumber2() As String
|
|
Get
|
|
Return Me._registrationNumber2
|
|
End Get
|
|
Set
|
|
Me._registrationNumber2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property registrationNumber3() As String
|
|
Get
|
|
Return Me._registrationNumber3
|
|
End Get
|
|
Set
|
|
Me._registrationNumber3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property registrationNumber4() As String
|
|
Get
|
|
Return Me._registrationNumber4
|
|
End Get
|
|
Set
|
|
Me._registrationNumber4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property registrationNumberOld() As String
|
|
Get
|
|
Return Me._registrationNumberOld
|
|
End Get
|
|
Set
|
|
Me._registrationNumberOld = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property registrationNumber2Old() As String
|
|
Get
|
|
Return Me._registrationNumber2Old
|
|
End Get
|
|
Set
|
|
Me._registrationNumber2Old = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property messageRefNumber1() As String
|
|
Get
|
|
Return Me._messageRefNumber1
|
|
End Get
|
|
Set
|
|
Me._messageRefNumber1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property messageRefNumber2() As String
|
|
Get
|
|
Return Me._messageRefNumber2
|
|
End Get
|
|
Set
|
|
Me._messageRefNumber2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property messageRefNumber3() As String
|
|
Get
|
|
Return Me._messageRefNumber3
|
|
End Get
|
|
Set
|
|
Me._messageRefNumber3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property positionNumber1() As Decimal
|
|
Get
|
|
Return Me._positionNumber1
|
|
End Get
|
|
Set
|
|
Me._positionNumber1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property positionNumber2() As Decimal
|
|
Get
|
|
Return Me._positionNumber2
|
|
End Get
|
|
Set
|
|
Me._positionNumber2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicImportRegistrationNo))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicImportRegistrationNo object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicImportRegistrationNo object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicImportRegistrationNo 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 TMicImportRegistrationNo, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicImportRegistrationNo)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicImportRegistrationNo) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicImportRegistrationNo
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicImportRegistrationNo)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicImportRegistrationNo
|
|
Return CType(SerializerXml.Deserialize(s), TMicImportRegistrationNo)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicImportRegistrationNo 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicImportRegistrationNo object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicImportRegistrationNo 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 TMicImportRegistrationNo, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicImportRegistrationNo)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicImportRegistrationNo) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicImportRegistrationNo
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicReceipt
|
|
|
|
#Region "Private fields"
|
|
Private _receiptNumber As String
|
|
|
|
Private _receiptDate As Date
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property receiptNumber() As String
|
|
Get
|
|
Return Me._receiptNumber
|
|
End Get
|
|
Set
|
|
Me._receiptNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property receiptDate() As Date
|
|
Get
|
|
Return Me._receiptDate
|
|
End Get
|
|
Set
|
|
Me._receiptDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicReceipt))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicReceipt object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicReceipt object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicReceipt 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 TMicReceipt, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicReceipt)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicReceipt) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicReceipt
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicReceipt)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicReceipt
|
|
Return CType(SerializerXml.Deserialize(s), TMicReceipt)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicReceipt 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicReceipt object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicReceipt 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 TMicReceipt, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicReceipt)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicReceipt) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicReceipt
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicPackage
|
|
|
|
#Region "Private fields"
|
|
Private _packageCount As Decimal
|
|
|
|
Private _packageType As String
|
|
|
|
Private _packageDescription As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property packageCount() As Decimal
|
|
Get
|
|
Return Me._packageCount
|
|
End Get
|
|
Set
|
|
Me._packageCount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property packageType() As String
|
|
Get
|
|
Return Me._packageType
|
|
End Get
|
|
Set
|
|
Me._packageType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property packageDescription() As String
|
|
Get
|
|
Return Me._packageDescription
|
|
End Get
|
|
Set
|
|
Me._packageDescription = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPackage))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicPackage object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicPackage object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicPackage 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 TMicPackage, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicPackage)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicPackage) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicPackage
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicPackage)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicPackage
|
|
Return CType(SerializerXml.Deserialize(s), TMicPackage)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicPackage 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicPackage object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicPackage 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 TMicPackage, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicPackage)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicPackage) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicPackage
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicBom
|
|
|
|
#Region "Private fields"
|
|
Private _no As String
|
|
|
|
Private _var As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property no() As String
|
|
Get
|
|
Return Me._no
|
|
End Get
|
|
Set
|
|
Me._no = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property var() As String
|
|
Get
|
|
Return Me._var
|
|
End Get
|
|
Set
|
|
Me._var = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicBom))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicBom object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicBom object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicBom 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 TMicBom, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicBom)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicBom) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicBom
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicBom)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicBom
|
|
Return CType(SerializerXml.Deserialize(s), TMicBom)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicBom 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicBom object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicBom 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 TMicBom, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicBom)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicBom) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicBom
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicPreviousDocument
|
|
|
|
#Region "Private fields"
|
|
Private _previousDocType As String
|
|
|
|
Private _previousDocNumber As String
|
|
|
|
Private _previousDocDate As Date
|
|
|
|
Private _customsDate As Date
|
|
|
|
Private _departureCustomsOffice As String
|
|
|
|
Private _destinationCustomsOffice As String
|
|
|
|
Private _type As String
|
|
|
|
Private _creationUser As String
|
|
|
|
Private _creationDate As Date
|
|
|
|
Private _modificationUser As String
|
|
|
|
Private _modificationDate As Date
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property previousDocType() As String
|
|
Get
|
|
Return Me._previousDocType
|
|
End Get
|
|
Set
|
|
Me._previousDocType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property previousDocNumber() As String
|
|
Get
|
|
Return Me._previousDocNumber
|
|
End Get
|
|
Set
|
|
Me._previousDocNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property previousDocDate() As Date
|
|
Get
|
|
Return Me._previousDocDate
|
|
End Get
|
|
Set
|
|
Me._previousDocDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property customsDate() As Date
|
|
Get
|
|
Return Me._customsDate
|
|
End Get
|
|
Set
|
|
Me._customsDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property departureCustomsOffice() As String
|
|
Get
|
|
Return Me._departureCustomsOffice
|
|
End Get
|
|
Set
|
|
Me._departureCustomsOffice = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property destinationCustomsOffice() As String
|
|
Get
|
|
Return Me._destinationCustomsOffice
|
|
End Get
|
|
Set
|
|
Me._destinationCustomsOffice = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property type() As String
|
|
Get
|
|
Return Me._type
|
|
End Get
|
|
Set
|
|
Me._type = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationUser() As String
|
|
Get
|
|
Return Me._creationUser
|
|
End Get
|
|
Set
|
|
Me._creationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationDate() As Date
|
|
Get
|
|
Return Me._creationDate
|
|
End Get
|
|
Set
|
|
Me._creationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationUser() As String
|
|
Get
|
|
Return Me._modificationUser
|
|
End Get
|
|
Set
|
|
Me._modificationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationDate() As Date
|
|
Get
|
|
Return Me._modificationDate
|
|
End Get
|
|
Set
|
|
Me._modificationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPreviousDocument))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicPreviousDocument object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicPreviousDocument object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicPreviousDocument 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 TMicPreviousDocument, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicPreviousDocument)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicPreviousDocument) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicPreviousDocument
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicPreviousDocument)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicPreviousDocument
|
|
Return CType(SerializerXml.Deserialize(s), TMicPreviousDocument)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicPreviousDocument 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicPreviousDocument object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicPreviousDocument 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 TMicPreviousDocument, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicPreviousDocument)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicPreviousDocument) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicPreviousDocument
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicPreviousDocuments
|
|
|
|
#Region "Private fields"
|
|
Private _previousDocument As List(Of TMicPreviousDocument)
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._previousDocument = New List(Of TMicPreviousDocument)()
|
|
End Sub
|
|
|
|
<XmlElement("PreviousDocument")>
|
|
Public Property PreviousDocument() As List(Of TMicPreviousDocument)
|
|
Get
|
|
Return Me._previousDocument
|
|
End Get
|
|
Set
|
|
Me._previousDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPreviousDocuments))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicPreviousDocuments object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicPreviousDocuments object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicPreviousDocuments 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 TMicPreviousDocuments, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicPreviousDocuments)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicPreviousDocuments) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicPreviousDocuments
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicPreviousDocuments)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicPreviousDocuments
|
|
Return CType(SerializerXml.Deserialize(s), TMicPreviousDocuments)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicPreviousDocuments 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicPreviousDocuments object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicPreviousDocuments 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 TMicPreviousDocuments, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicPreviousDocuments)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicPreviousDocuments) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicPreviousDocuments
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicAdditionalCostsVAT
|
|
|
|
#Region "Private fields"
|
|
Private _addAmountVAT As Decimal
|
|
|
|
Private _addCurrencyVAT As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property addAmountVAT() As Decimal
|
|
Get
|
|
Return Me._addAmountVAT
|
|
End Get
|
|
Set
|
|
Me._addAmountVAT = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property addCurrencyVAT() As String
|
|
Get
|
|
Return Me._addCurrencyVAT
|
|
End Get
|
|
Set
|
|
Me._addCurrencyVAT = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAdditionalCostsVAT))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicAdditionalCostsVAT object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicAdditionalCostsVAT object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicAdditionalCostsVAT 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 TMicAdditionalCostsVAT, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicAdditionalCostsVAT)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicAdditionalCostsVAT) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicAdditionalCostsVAT
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicAdditionalCostsVAT)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicAdditionalCostsVAT
|
|
Return CType(SerializerXml.Deserialize(s), TMicAdditionalCostsVAT)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicAdditionalCostsVAT 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicAdditionalCostsVAT object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicAdditionalCostsVAT 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 TMicAdditionalCostsVAT, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicAdditionalCostsVAT)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicAdditionalCostsVAT) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicAdditionalCostsVAT
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicRebateLine
|
|
|
|
#Region "Private fields"
|
|
Private _rebAmount As Decimal
|
|
|
|
Private _rebCurrency As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property rebAmount() As Decimal
|
|
Get
|
|
Return Me._rebAmount
|
|
End Get
|
|
Set
|
|
Me._rebAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property rebCurrency() As String
|
|
Get
|
|
Return Me._rebCurrency
|
|
End Get
|
|
Set
|
|
Me._rebCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicRebateLine))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicRebateLine object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicRebateLine object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicRebateLine 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 TMicRebateLine, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicRebateLine)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicRebateLine) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicRebateLine
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicRebateLine)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicRebateLine
|
|
Return CType(SerializerXml.Deserialize(s), TMicRebateLine)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicRebateLine 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicRebateLine object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicRebateLine 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 TMicRebateLine, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicRebateLine)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicRebateLine) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicRebateLine
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicInsuranceCostsLine
|
|
|
|
#Region "Private fields"
|
|
Private _insAmount As Decimal
|
|
|
|
Private _insCurrency As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property insAmount() As Decimal
|
|
Get
|
|
Return Me._insAmount
|
|
End Get
|
|
Set
|
|
Me._insAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property insCurrency() As String
|
|
Get
|
|
Return Me._insCurrency
|
|
End Get
|
|
Set
|
|
Me._insCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInsuranceCostsLine))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicInsuranceCostsLine object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicInsuranceCostsLine object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicInsuranceCostsLine 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 TMicInsuranceCostsLine, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicInsuranceCostsLine)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicInsuranceCostsLine) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicInsuranceCostsLine
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInsuranceCostsLine)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicInsuranceCostsLine
|
|
Return CType(SerializerXml.Deserialize(s), TMicInsuranceCostsLine)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicInsuranceCostsLine 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicInsuranceCostsLine object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicInsuranceCostsLine 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 TMicInsuranceCostsLine, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicInsuranceCostsLine)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicInsuranceCostsLine) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicInsuranceCostsLine
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicFreightCostsLine
|
|
|
|
#Region "Private fields"
|
|
Private _frtAmount As Decimal
|
|
|
|
Private _frtCurrency As String
|
|
|
|
Private _frtInternational As Decimal
|
|
|
|
Private _frtEuNational As Decimal
|
|
|
|
Private _frtInland As Decimal
|
|
|
|
Private _frtFlagPercentOrValue As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._frtFlagPercentOrValue = "P"
|
|
End Sub
|
|
|
|
Public Property frtAmount() As Decimal
|
|
Get
|
|
Return Me._frtAmount
|
|
End Get
|
|
Set
|
|
Me._frtAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property frtCurrency() As String
|
|
Get
|
|
Return Me._frtCurrency
|
|
End Get
|
|
Set
|
|
Me._frtCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property frtInternational() As Decimal
|
|
Get
|
|
Return Me._frtInternational
|
|
End Get
|
|
Set
|
|
Me._frtInternational = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property frtEuNational() As Decimal
|
|
Get
|
|
Return Me._frtEuNational
|
|
End Get
|
|
Set
|
|
Me._frtEuNational = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property frtInland() As Decimal
|
|
Get
|
|
Return Me._frtInland
|
|
End Get
|
|
Set
|
|
Me._frtInland = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlAttribute,
|
|
System.ComponentModel.DefaultValue("P")>
|
|
Public Property frtFlagPercentOrValue() As String
|
|
Get
|
|
Return Me._frtFlagPercentOrValue
|
|
End Get
|
|
Set
|
|
Me._frtFlagPercentOrValue = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicFreightCostsLine))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicFreightCostsLine object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicFreightCostsLine object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicFreightCostsLine 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 TMicFreightCostsLine, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicFreightCostsLine)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicFreightCostsLine) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicFreightCostsLine
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicFreightCostsLine)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicFreightCostsLine
|
|
Return CType(SerializerXml.Deserialize(s), TMicFreightCostsLine)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicFreightCostsLine 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicFreightCostsLine object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicFreightCostsLine 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 TMicFreightCostsLine, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicFreightCostsLine)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicFreightCostsLine) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicFreightCostsLine
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicPricing
|
|
|
|
#Region "Private fields"
|
|
Private _prcType As String
|
|
|
|
Private _prcReference As String
|
|
|
|
Private _prcDate As Date
|
|
|
|
Private _prcSystem As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property prcType() As String
|
|
Get
|
|
Return Me._prcType
|
|
End Get
|
|
Set
|
|
Me._prcType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property prcReference() As String
|
|
Get
|
|
Return Me._prcReference
|
|
End Get
|
|
Set
|
|
Me._prcReference = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property prcDate() As Date
|
|
Get
|
|
Return Me._prcDate
|
|
End Get
|
|
Set
|
|
Me._prcDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property prcSystem() As String
|
|
Get
|
|
Return Me._prcSystem
|
|
End Get
|
|
Set
|
|
Me._prcSystem = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPricing))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicPricing object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicPricing object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicPricing 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 TMicPricing, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicPricing)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicPricing) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicPricing
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicPricing)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicPricing
|
|
Return CType(SerializerXml.Deserialize(s), TMicPricing)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicPricing 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicPricing object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicPricing 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 TMicPricing, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicPricing)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicPricing) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicPricing
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicImportLineLicense
|
|
|
|
#Region "Private fields"
|
|
Private _type As String
|
|
|
|
Private _code As String
|
|
|
|
Private _number As String
|
|
|
|
Private _date As Date
|
|
|
|
Private _notRequired As Boolean
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property type() As String
|
|
Get
|
|
Return Me._type
|
|
End Get
|
|
Set
|
|
Me._type = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property code() As String
|
|
Get
|
|
Return Me._code
|
|
End Get
|
|
Set
|
|
Me._code = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number() As String
|
|
Get
|
|
Return Me._number
|
|
End Get
|
|
Set
|
|
Me._number = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property [date]() As Date
|
|
Get
|
|
Return Me._date
|
|
End Get
|
|
Set
|
|
Me._date = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property notRequired() As Boolean
|
|
Get
|
|
Return Me._notRequired
|
|
End Get
|
|
Set
|
|
Me._notRequired = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicImportLineLicense))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicImportLineLicense object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicImportLineLicense object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicImportLineLicense 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 TMicImportLineLicense, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicImportLineLicense)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicImportLineLicense) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicImportLineLicense
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicImportLineLicense)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicImportLineLicense
|
|
Return CType(SerializerXml.Deserialize(s), TMicImportLineLicense)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicImportLineLicense 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicImportLineLicense object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicImportLineLicense 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 TMicImportLineLicense, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicImportLineLicense)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicImportLineLicense) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicImportLineLicense
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicTariffCode
|
|
|
|
#Region "Private fields"
|
|
Private _hsCode As String
|
|
|
|
Private _vatCode As String
|
|
|
|
Private _exciseTaxCode As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property hsCode() As String
|
|
Get
|
|
Return Me._hsCode
|
|
End Get
|
|
Set
|
|
Me._hsCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property vatCode() As String
|
|
Get
|
|
Return Me._vatCode
|
|
End Get
|
|
Set
|
|
Me._vatCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property exciseTaxCode() As String
|
|
Get
|
|
Return Me._exciseTaxCode
|
|
End Get
|
|
Set
|
|
Me._exciseTaxCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicTariffCode))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicTariffCode object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicTariffCode object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicTariffCode 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 TMicTariffCode, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicTariffCode)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicTariffCode) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicTariffCode
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicTariffCode)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicTariffCode
|
|
Return CType(SerializerXml.Deserialize(s), TMicTariffCode)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicTariffCode 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicTariffCode object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicTariffCode 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 TMicTariffCode, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicTariffCode)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicTariffCode) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicTariffCode
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicItem
|
|
|
|
#Region "Private fields"
|
|
Private _partNumber As String
|
|
|
|
Private _partDescription As String
|
|
|
|
Private _serialNumber As String
|
|
|
|
Private _productGroup As String
|
|
|
|
Private _model As String
|
|
|
|
Private _brand As String
|
|
|
|
Private _manufacturerNumber As String
|
|
|
|
Private _ctoNumber As String
|
|
|
|
Private _confidenceLevel As Long
|
|
|
|
Private _productCategory As String
|
|
|
|
Private _usage As String
|
|
|
|
Private _usageType As String
|
|
|
|
Private _tariffCode As TMicTariffCode
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._tariffCode = New TMicTariffCode()
|
|
End Sub
|
|
|
|
Public Property partNumber() As String
|
|
Get
|
|
Return Me._partNumber
|
|
End Get
|
|
Set
|
|
Me._partNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property partDescription() As String
|
|
Get
|
|
Return Me._partDescription
|
|
End Get
|
|
Set
|
|
Me._partDescription = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property serialNumber() As String
|
|
Get
|
|
Return Me._serialNumber
|
|
End Get
|
|
Set
|
|
Me._serialNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property productGroup() As String
|
|
Get
|
|
Return Me._productGroup
|
|
End Get
|
|
Set
|
|
Me._productGroup = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property model() As String
|
|
Get
|
|
Return Me._model
|
|
End Get
|
|
Set
|
|
Me._model = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property brand() As String
|
|
Get
|
|
Return Me._brand
|
|
End Get
|
|
Set
|
|
Me._brand = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property manufacturerNumber() As String
|
|
Get
|
|
Return Me._manufacturerNumber
|
|
End Get
|
|
Set
|
|
Me._manufacturerNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ctoNumber() As String
|
|
Get
|
|
Return Me._ctoNumber
|
|
End Get
|
|
Set
|
|
Me._ctoNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property confidenceLevel() As Long
|
|
Get
|
|
Return Me._confidenceLevel
|
|
End Get
|
|
Set
|
|
Me._confidenceLevel = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property productCategory() As String
|
|
Get
|
|
Return Me._productCategory
|
|
End Get
|
|
Set
|
|
Me._productCategory = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property usage() As String
|
|
Get
|
|
Return Me._usage
|
|
End Get
|
|
Set
|
|
Me._usage = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property usageType() As String
|
|
Get
|
|
Return Me._usageType
|
|
End Get
|
|
Set
|
|
Me._usageType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property TariffCode() As TMicTariffCode
|
|
Get
|
|
Return Me._tariffCode
|
|
End Get
|
|
Set
|
|
Me._tariffCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicItem))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicItem object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicItem object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicItem 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 TMicItem, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicItem)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicItem) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicItem
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicItem)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicItem
|
|
Return CType(SerializerXml.Deserialize(s), TMicItem)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicItem 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicItem object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicItem 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 TMicItem, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicItem)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicItem) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicItem
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicInvoiceLine
|
|
|
|
#Region "Private fields"
|
|
Private _lineNumber As Decimal
|
|
|
|
Private _item As TMicItem
|
|
|
|
Private _quantity As Decimal
|
|
|
|
Private _quantityUom As String
|
|
|
|
Private _netWeight As Decimal
|
|
|
|
Private _grossWeight As Decimal
|
|
|
|
Private _reportingQuantity As Decimal
|
|
|
|
Private _reportingQuantityUom As String
|
|
|
|
Private _price As Decimal
|
|
|
|
Private _lineValue As Decimal
|
|
|
|
Private _license As TMicImportLineLicense
|
|
|
|
Private _pricing As TMicPricing
|
|
|
|
Private _freightCosts As TMicFreightCostsLine
|
|
|
|
Private _insuranceCosts As TMicInsuranceCostsLine
|
|
|
|
Private _additionalCost As List(Of TMicAdditionalCosts)
|
|
|
|
Private _rebate As TMicRebateLine
|
|
|
|
Private _additionalCostsVAT As TMicAdditionalCostsVAT
|
|
|
|
Private _countryOfOrigin As String
|
|
|
|
Private _prefCountryOfOrigin As String
|
|
|
|
Private _locationOfGoods As String
|
|
|
|
Private _importQuota As String
|
|
|
|
Private _importQuotaKey As String
|
|
|
|
Private _importQuotaQuantity As Decimal
|
|
|
|
Private _importQuotaUnitOfMeasurement As String
|
|
|
|
Private _importQuotaQualifier As String
|
|
|
|
Private _customsProcedure As String
|
|
|
|
Private _statisticalCode As String
|
|
|
|
Private _endUseIndicator As String
|
|
|
|
Private _transactionType As String
|
|
|
|
Private _valuationMethod As String
|
|
|
|
Private _addCode As List(Of String)
|
|
|
|
Private _prefRequestCode As String
|
|
|
|
Private _documents As TMicDocuments
|
|
|
|
Private _previousDocument As TMicPreviousDocuments
|
|
|
|
Private _bOM As TMicBom
|
|
|
|
Private _stockType As String
|
|
|
|
Private _stockType2 As String
|
|
|
|
Private _stockExpiryDate As Date
|
|
|
|
Private _package As TMicPackage
|
|
|
|
Private _accountNumber As String
|
|
|
|
Private _deliveryNote As String
|
|
|
|
Private _orderNumber As String
|
|
|
|
Private _orderPosition As Long
|
|
|
|
Private _receipt As TMicReceipt
|
|
|
|
Private _asnNumber As String
|
|
|
|
Private _referenceValue As Decimal
|
|
|
|
Private _referenceCurrency As String
|
|
|
|
Private _text As String
|
|
|
|
Private _text2 As String
|
|
|
|
Private _registrationNumbers As TMicImportRegistrationNo
|
|
|
|
Private _customerFields As TMicLinesCustomerFields
|
|
|
|
Private _attributes As TMicAttributes
|
|
|
|
Private _containerInfo As TMicContainerInfo
|
|
|
|
Private _partners As TMicPartners
|
|
|
|
Private _calculatedValues As TMicCalculatedValues
|
|
|
|
Private _calculatedValuesCust As TMicCalculatedValuesCust
|
|
|
|
Private _duties As TMicDuties
|
|
|
|
Private _dutyTaxes As TMicDutyTaxes
|
|
|
|
Private _dutySavings As TMicDutySavings
|
|
|
|
Private _oprDetails As TMicOprInfo
|
|
|
|
Private _additionalParams As TMicImportLineAdditionalParams
|
|
|
|
Private _uniqueId As Decimal
|
|
|
|
Private _externalProcessing As String
|
|
|
|
Private _additionalInformation As TMicAttributes
|
|
|
|
Private _intra As TMicCustIntraLine
|
|
|
|
Private _preSupplier As TMicPreSupplier
|
|
|
|
Private _ucr As String
|
|
|
|
Private _cusCode As String
|
|
|
|
Private _creationUser As String
|
|
|
|
Private _creationDate As Date
|
|
|
|
Private _modificationUser As String
|
|
|
|
Private _modificationDate As Date
|
|
|
|
Private _valuationIndicator As String
|
|
|
|
Private _trackingNumber As String
|
|
|
|
Private _referencePreviousProcedures As TReferencePreviousProcedures
|
|
|
|
Private _packagesData As TMicPackagesData
|
|
|
|
Private _authorisationHolders As TMicAuthHolders
|
|
|
|
Private _acceptanceDate As Date
|
|
|
|
Private _noCertOrigin As Boolean
|
|
|
|
Private _manualContribution As Decimal
|
|
|
|
Private _manualContributionCurrency As String
|
|
|
|
Private _eudr As TMicInvoiceLineEudr
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._eudr = New TMicInvoiceLineEudr()
|
|
Me._authorisationHolders = New TMicAuthHolders()
|
|
Me._packagesData = New TMicPackagesData()
|
|
Me._referencePreviousProcedures = New TReferencePreviousProcedures()
|
|
Me._preSupplier = New TMicPreSupplier()
|
|
Me._intra = New TMicCustIntraLine()
|
|
Me._additionalInformation = New TMicAttributes()
|
|
Me._additionalParams = New TMicImportLineAdditionalParams()
|
|
Me._oprDetails = New TMicOprInfo()
|
|
Me._dutySavings = New TMicDutySavings()
|
|
Me._dutyTaxes = New TMicDutyTaxes()
|
|
Me._duties = New TMicDuties()
|
|
Me._calculatedValuesCust = New TMicCalculatedValuesCust()
|
|
Me._calculatedValues = New TMicCalculatedValues()
|
|
Me._partners = New TMicPartners()
|
|
Me._containerInfo = New TMicContainerInfo()
|
|
Me._attributes = New TMicAttributes()
|
|
Me._customerFields = New TMicLinesCustomerFields()
|
|
Me._registrationNumbers = New TMicImportRegistrationNo()
|
|
Me._receipt = New TMicReceipt()
|
|
Me._package = New TMicPackage()
|
|
Me._bOM = New TMicBom()
|
|
Me._previousDocument = New TMicPreviousDocuments()
|
|
Me._documents = New TMicDocuments()
|
|
Me._addCode = New List(Of String)()
|
|
Me._additionalCostsVAT = New TMicAdditionalCostsVAT()
|
|
Me._rebate = New TMicRebateLine()
|
|
Me._additionalCost = New List(Of TMicAdditionalCosts)()
|
|
Me._insuranceCosts = New TMicInsuranceCostsLine()
|
|
Me._freightCosts = New TMicFreightCostsLine()
|
|
Me._pricing = New TMicPricing()
|
|
Me._license = New TMicImportLineLicense()
|
|
Me._item = New TMicItem()
|
|
End Sub
|
|
|
|
Public Property lineNumber() As Decimal
|
|
Get
|
|
Return Me._lineNumber
|
|
End Get
|
|
Set
|
|
Me._lineNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Item() As TMicItem
|
|
Get
|
|
Return Me._item
|
|
End Get
|
|
Set
|
|
Me._item = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property quantity() As Decimal
|
|
Get
|
|
Return Me._quantity
|
|
End Get
|
|
Set
|
|
Me._quantity = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property quantityUom() As String
|
|
Get
|
|
Return Me._quantityUom
|
|
End Get
|
|
Set
|
|
Me._quantityUom = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property netWeight() As Decimal
|
|
Get
|
|
Return Me._netWeight
|
|
End Get
|
|
Set
|
|
Me._netWeight = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property grossWeight() As Decimal
|
|
Get
|
|
Return Me._grossWeight
|
|
End Get
|
|
Set
|
|
Me._grossWeight = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property reportingQuantity() As Decimal
|
|
Get
|
|
Return Me._reportingQuantity
|
|
End Get
|
|
Set
|
|
Me._reportingQuantity = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property reportingQuantityUom() As String
|
|
Get
|
|
Return Me._reportingQuantityUom
|
|
End Get
|
|
Set
|
|
Me._reportingQuantityUom = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property price() As Decimal
|
|
Get
|
|
Return Me._price
|
|
End Get
|
|
Set
|
|
Me._price = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property lineValue() As Decimal
|
|
Get
|
|
Return Me._lineValue
|
|
End Get
|
|
Set
|
|
Me._lineValue = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property License() As TMicImportLineLicense
|
|
Get
|
|
Return Me._license
|
|
End Get
|
|
Set
|
|
Me._license = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Pricing() As TMicPricing
|
|
Get
|
|
Return Me._pricing
|
|
End Get
|
|
Set
|
|
Me._pricing = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property FreightCosts() As TMicFreightCostsLine
|
|
Get
|
|
Return Me._freightCosts
|
|
End Get
|
|
Set
|
|
Me._freightCosts = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property InsuranceCosts() As TMicInsuranceCostsLine
|
|
Get
|
|
Return Me._insuranceCosts
|
|
End Get
|
|
Set
|
|
Me._insuranceCosts = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("AdditionalCost")>
|
|
Public Property AdditionalCost() As List(Of TMicAdditionalCosts)
|
|
Get
|
|
Return Me._additionalCost
|
|
End Get
|
|
Set
|
|
Me._additionalCost = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Rebate() As TMicRebateLine
|
|
Get
|
|
Return Me._rebate
|
|
End Get
|
|
Set
|
|
Me._rebate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property AdditionalCostsVAT() As TMicAdditionalCostsVAT
|
|
Get
|
|
Return Me._additionalCostsVAT
|
|
End Get
|
|
Set
|
|
Me._additionalCostsVAT = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property countryOfOrigin() As String
|
|
Get
|
|
Return Me._countryOfOrigin
|
|
End Get
|
|
Set
|
|
Me._countryOfOrigin = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property prefCountryOfOrigin() As String
|
|
Get
|
|
Return Me._prefCountryOfOrigin
|
|
End Get
|
|
Set
|
|
Me._prefCountryOfOrigin = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property locationOfGoods() As String
|
|
Get
|
|
Return Me._locationOfGoods
|
|
End Get
|
|
Set
|
|
Me._locationOfGoods = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property importQuota() As String
|
|
Get
|
|
Return Me._importQuota
|
|
End Get
|
|
Set
|
|
Me._importQuota = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property importQuotaKey() As String
|
|
Get
|
|
Return Me._importQuotaKey
|
|
End Get
|
|
Set
|
|
Me._importQuotaKey = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property importQuotaQuantity() As Decimal
|
|
Get
|
|
Return Me._importQuotaQuantity
|
|
End Get
|
|
Set
|
|
Me._importQuotaQuantity = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property importQuotaUnitOfMeasurement() As String
|
|
Get
|
|
Return Me._importQuotaUnitOfMeasurement
|
|
End Get
|
|
Set
|
|
Me._importQuotaUnitOfMeasurement = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property importQuotaQualifier() As String
|
|
Get
|
|
Return Me._importQuotaQualifier
|
|
End Get
|
|
Set
|
|
Me._importQuotaQualifier = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property customsProcedure() As String
|
|
Get
|
|
Return Me._customsProcedure
|
|
End Get
|
|
Set
|
|
Me._customsProcedure = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property statisticalCode() As String
|
|
Get
|
|
Return Me._statisticalCode
|
|
End Get
|
|
Set
|
|
Me._statisticalCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property endUseIndicator() As String
|
|
Get
|
|
Return Me._endUseIndicator
|
|
End Get
|
|
Set
|
|
Me._endUseIndicator = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property transactionType() As String
|
|
Get
|
|
Return Me._transactionType
|
|
End Get
|
|
Set
|
|
Me._transactionType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property valuationMethod() As String
|
|
Get
|
|
Return Me._valuationMethod
|
|
End Get
|
|
Set
|
|
Me._valuationMethod = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("addCode")>
|
|
Public Property addCode() As List(Of String)
|
|
Get
|
|
Return Me._addCode
|
|
End Get
|
|
Set
|
|
Me._addCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property prefRequestCode() As String
|
|
Get
|
|
Return Me._prefRequestCode
|
|
End Get
|
|
Set
|
|
Me._prefRequestCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Documents() As TMicDocuments
|
|
Get
|
|
Return Me._documents
|
|
End Get
|
|
Set
|
|
Me._documents = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property PreviousDocument() As TMicPreviousDocuments
|
|
Get
|
|
Return Me._previousDocument
|
|
End Get
|
|
Set
|
|
Me._previousDocument = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property BOM() As TMicBom
|
|
Get
|
|
Return Me._bOM
|
|
End Get
|
|
Set
|
|
Me._bOM = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property stockType() As String
|
|
Get
|
|
Return Me._stockType
|
|
End Get
|
|
Set
|
|
Me._stockType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property stockType2() As String
|
|
Get
|
|
Return Me._stockType2
|
|
End Get
|
|
Set
|
|
Me._stockType2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property stockExpiryDate() As Date
|
|
Get
|
|
Return Me._stockExpiryDate
|
|
End Get
|
|
Set
|
|
Me._stockExpiryDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Package() As TMicPackage
|
|
Get
|
|
Return Me._package
|
|
End Get
|
|
Set
|
|
Me._package = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property accountNumber() As String
|
|
Get
|
|
Return Me._accountNumber
|
|
End Get
|
|
Set
|
|
Me._accountNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property deliveryNote() As String
|
|
Get
|
|
Return Me._deliveryNote
|
|
End Get
|
|
Set
|
|
Me._deliveryNote = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property orderNumber() As String
|
|
Get
|
|
Return Me._orderNumber
|
|
End Get
|
|
Set
|
|
Me._orderNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property orderPosition() As Long
|
|
Get
|
|
Return Me._orderPosition
|
|
End Get
|
|
Set
|
|
Me._orderPosition = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Receipt() As TMicReceipt
|
|
Get
|
|
Return Me._receipt
|
|
End Get
|
|
Set
|
|
Me._receipt = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property asnNumber() As String
|
|
Get
|
|
Return Me._asnNumber
|
|
End Get
|
|
Set
|
|
Me._asnNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property referenceValue() As Decimal
|
|
Get
|
|
Return Me._referenceValue
|
|
End Get
|
|
Set
|
|
Me._referenceValue = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property referenceCurrency() As String
|
|
Get
|
|
Return Me._referenceCurrency
|
|
End Get
|
|
Set
|
|
Me._referenceCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text() As String
|
|
Get
|
|
Return Me._text
|
|
End Get
|
|
Set
|
|
Me._text = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text2() As String
|
|
Get
|
|
Return Me._text2
|
|
End Get
|
|
Set
|
|
Me._text2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property RegistrationNumbers() As TMicImportRegistrationNo
|
|
Get
|
|
Return Me._registrationNumbers
|
|
End Get
|
|
Set
|
|
Me._registrationNumbers = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property CustomerFields() As TMicLinesCustomerFields
|
|
Get
|
|
Return Me._customerFields
|
|
End Get
|
|
Set
|
|
Me._customerFields = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Attributes() As TMicAttributes
|
|
Get
|
|
Return Me._attributes
|
|
End Get
|
|
Set
|
|
Me._attributes = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ContainerInfo() As TMicContainerInfo
|
|
Get
|
|
Return Me._containerInfo
|
|
End Get
|
|
Set
|
|
Me._containerInfo = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Partners() As TMicPartners
|
|
Get
|
|
Return Me._partners
|
|
End Get
|
|
Set
|
|
Me._partners = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property CalculatedValues() As TMicCalculatedValues
|
|
Get
|
|
Return Me._calculatedValues
|
|
End Get
|
|
Set
|
|
Me._calculatedValues = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property CalculatedValuesCust() As TMicCalculatedValuesCust
|
|
Get
|
|
Return Me._calculatedValuesCust
|
|
End Get
|
|
Set
|
|
Me._calculatedValuesCust = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Duties() As TMicDuties
|
|
Get
|
|
Return Me._duties
|
|
End Get
|
|
Set
|
|
Me._duties = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property DutyTaxes() As TMicDutyTaxes
|
|
Get
|
|
Return Me._dutyTaxes
|
|
End Get
|
|
Set
|
|
Me._dutyTaxes = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property DutySavings() As TMicDutySavings
|
|
Get
|
|
Return Me._dutySavings
|
|
End Get
|
|
Set
|
|
Me._dutySavings = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property OprDetails() As TMicOprInfo
|
|
Get
|
|
Return Me._oprDetails
|
|
End Get
|
|
Set
|
|
Me._oprDetails = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property AdditionalParams() As TMicImportLineAdditionalParams
|
|
Get
|
|
Return Me._additionalParams
|
|
End Get
|
|
Set
|
|
Me._additionalParams = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property uniqueId() As Decimal
|
|
Get
|
|
Return Me._uniqueId
|
|
End Get
|
|
Set
|
|
Me._uniqueId = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property externalProcessing() As String
|
|
Get
|
|
Return Me._externalProcessing
|
|
End Get
|
|
Set
|
|
Me._externalProcessing = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property AdditionalInformation() As TMicAttributes
|
|
Get
|
|
Return Me._additionalInformation
|
|
End Get
|
|
Set
|
|
Me._additionalInformation = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Intra() As TMicCustIntraLine
|
|
Get
|
|
Return Me._intra
|
|
End Get
|
|
Set
|
|
Me._intra = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property PreSupplier() As TMicPreSupplier
|
|
Get
|
|
Return Me._preSupplier
|
|
End Get
|
|
Set
|
|
Me._preSupplier = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ucr() As String
|
|
Get
|
|
Return Me._ucr
|
|
End Get
|
|
Set
|
|
Me._ucr = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property cusCode() As String
|
|
Get
|
|
Return Me._cusCode
|
|
End Get
|
|
Set
|
|
Me._cusCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationUser() As String
|
|
Get
|
|
Return Me._creationUser
|
|
End Get
|
|
Set
|
|
Me._creationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationDate() As Date
|
|
Get
|
|
Return Me._creationDate
|
|
End Get
|
|
Set
|
|
Me._creationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationUser() As String
|
|
Get
|
|
Return Me._modificationUser
|
|
End Get
|
|
Set
|
|
Me._modificationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationDate() As Date
|
|
Get
|
|
Return Me._modificationDate
|
|
End Get
|
|
Set
|
|
Me._modificationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property valuationIndicator() As String
|
|
Get
|
|
Return Me._valuationIndicator
|
|
End Get
|
|
Set
|
|
Me._valuationIndicator = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property trackingNumber() As String
|
|
Get
|
|
Return Me._trackingNumber
|
|
End Get
|
|
Set
|
|
Me._trackingNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ReferencePreviousProcedures() As TReferencePreviousProcedures
|
|
Get
|
|
Return Me._referencePreviousProcedures
|
|
End Get
|
|
Set
|
|
Me._referencePreviousProcedures = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property PackagesData() As TMicPackagesData
|
|
Get
|
|
Return Me._packagesData
|
|
End Get
|
|
Set
|
|
Me._packagesData = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property AuthorisationHolders() As TMicAuthHolders
|
|
Get
|
|
Return Me._authorisationHolders
|
|
End Get
|
|
Set
|
|
Me._authorisationHolders = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property acceptanceDate() As Date
|
|
Get
|
|
Return Me._acceptanceDate
|
|
End Get
|
|
Set
|
|
Me._acceptanceDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property noCertOrigin() As Boolean
|
|
Get
|
|
Return Me._noCertOrigin
|
|
End Get
|
|
Set
|
|
Me._noCertOrigin = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property manualContribution() As Decimal
|
|
Get
|
|
Return Me._manualContribution
|
|
End Get
|
|
Set
|
|
Me._manualContribution = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property manualContributionCurrency() As String
|
|
Get
|
|
Return Me._manualContributionCurrency
|
|
End Get
|
|
Set
|
|
Me._manualContributionCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property eudr() As TMicInvoiceLineEudr
|
|
Get
|
|
Return Me._eudr
|
|
End Get
|
|
Set
|
|
Me._eudr = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInvoiceLine))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicInvoiceLine object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicInvoiceLine object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicInvoiceLine 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 TMicInvoiceLine, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicInvoiceLine)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicInvoiceLine) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicInvoiceLine
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInvoiceLine)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicInvoiceLine
|
|
Return CType(SerializerXml.Deserialize(s), TMicInvoiceLine)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicInvoiceLine 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicInvoiceLine object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicInvoiceLine 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 TMicInvoiceLine, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicInvoiceLine)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicInvoiceLine) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicInvoiceLine
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicAdditionalCosts
|
|
|
|
#Region "Private fields"
|
|
Private _addType As String
|
|
|
|
Private _addAmount As Decimal
|
|
|
|
Private _addCurrency As String
|
|
|
|
Private _addProRating As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property addType() As String
|
|
Get
|
|
Return Me._addType
|
|
End Get
|
|
Set
|
|
Me._addType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property addAmount() As Decimal
|
|
Get
|
|
Return Me._addAmount
|
|
End Get
|
|
Set
|
|
Me._addAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property addCurrency() As String
|
|
Get
|
|
Return Me._addCurrency
|
|
End Get
|
|
Set
|
|
Me._addCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property addProRating() As String
|
|
Get
|
|
Return Me._addProRating
|
|
End Get
|
|
Set
|
|
Me._addProRating = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAdditionalCosts))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicAdditionalCosts object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicAdditionalCosts object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicAdditionalCosts 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 TMicAdditionalCosts, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicAdditionalCosts)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicAdditionalCosts) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicAdditionalCosts
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicAdditionalCosts)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicAdditionalCosts
|
|
Return CType(SerializerXml.Deserialize(s), TMicAdditionalCosts)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicAdditionalCosts 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicAdditionalCosts object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicAdditionalCosts 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 TMicAdditionalCosts, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicAdditionalCosts)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicAdditionalCosts) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicAdditionalCosts
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicDocuments
|
|
|
|
#Region "Private fields"
|
|
Private _document As List(Of TMicDocument)
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._document = New List(Of TMicDocument)()
|
|
End Sub
|
|
|
|
<XmlElement("Document")>
|
|
Public Property Document() As List(Of TMicDocument)
|
|
Get
|
|
Return Me._document
|
|
End Get
|
|
Set
|
|
Me._document = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDocuments))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicDocuments object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicDocuments object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicDocuments 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 TMicDocuments, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDocuments)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicDocuments) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicDocuments
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDocuments)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicDocuments
|
|
Return CType(SerializerXml.Deserialize(s), TMicDocuments)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicDocuments 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicDocuments object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicDocuments 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 TMicDocuments, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDocuments)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicDocuments) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicDocuments
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicDocument
|
|
|
|
#Region "Private fields"
|
|
Private _docNo As String
|
|
|
|
Private _docDate As Date
|
|
|
|
Private _docType As String
|
|
|
|
Private _docQual As String
|
|
|
|
Private _docValidFrom As Date
|
|
|
|
Private _docValidTo As Date
|
|
|
|
Private _docAddText As String
|
|
|
|
Private _docQuantity As Decimal
|
|
|
|
Private _docUnit As String
|
|
|
|
Private _docValue As Decimal
|
|
|
|
Private _docStatUnit As String
|
|
|
|
Private _docMeasurementUnitWriteOff As String
|
|
|
|
Private _docAdditionalCostsCurrency As String
|
|
|
|
Private _docCurrency As String
|
|
|
|
Private _docCategory As String
|
|
|
|
Private _docWriteOffQuantity As Decimal
|
|
|
|
Private _docIssuerCountry As String
|
|
|
|
Private _docAvailableFlag As Boolean
|
|
|
|
Private _creationUser As String
|
|
|
|
Private _creationDate As Date
|
|
|
|
Private _modificationUser As String
|
|
|
|
Private _modificationDate As Date
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property docNo() As String
|
|
Get
|
|
Return Me._docNo
|
|
End Get
|
|
Set
|
|
Me._docNo = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(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
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property docValidFrom() As Date
|
|
Get
|
|
Return Me._docValidFrom
|
|
End Get
|
|
Set
|
|
Me._docValidFrom = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(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 docValue() As Decimal
|
|
Get
|
|
Return Me._docValue
|
|
End Get
|
|
Set
|
|
Me._docValue = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property docStatUnit() As String
|
|
Get
|
|
Return Me._docStatUnit
|
|
End Get
|
|
Set
|
|
Me._docStatUnit = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property docMeasurementUnitWriteOff() As String
|
|
Get
|
|
Return Me._docMeasurementUnitWriteOff
|
|
End Get
|
|
Set
|
|
Me._docMeasurementUnitWriteOff = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property docAdditionalCostsCurrency() As String
|
|
Get
|
|
Return Me._docAdditionalCostsCurrency
|
|
End Get
|
|
Set
|
|
Me._docAdditionalCostsCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property docCurrency() As String
|
|
Get
|
|
Return Me._docCurrency
|
|
End Get
|
|
Set
|
|
Me._docCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property docCategory() As String
|
|
Get
|
|
Return Me._docCategory
|
|
End Get
|
|
Set
|
|
Me._docCategory = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property docWriteOffQuantity() As Decimal
|
|
Get
|
|
Return Me._docWriteOffQuantity
|
|
End Get
|
|
Set
|
|
Me._docWriteOffQuantity = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property docIssuerCountry() As String
|
|
Get
|
|
Return Me._docIssuerCountry
|
|
End Get
|
|
Set
|
|
Me._docIssuerCountry = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property docAvailableFlag() As Boolean
|
|
Get
|
|
Return Me._docAvailableFlag
|
|
End Get
|
|
Set
|
|
Me._docAvailableFlag = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationUser() As String
|
|
Get
|
|
Return Me._creationUser
|
|
End Get
|
|
Set
|
|
Me._creationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationDate() As Date
|
|
Get
|
|
Return Me._creationDate
|
|
End Get
|
|
Set
|
|
Me._creationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationUser() As String
|
|
Get
|
|
Return Me._modificationUser
|
|
End Get
|
|
Set
|
|
Me._modificationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationDate() As Date
|
|
Get
|
|
Return Me._modificationDate
|
|
End Get
|
|
Set
|
|
Me._modificationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDocument))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicDocument object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicDocument object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicDocument 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 TMicDocument, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDocument)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicDocument) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicDocument
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDocument)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicDocument
|
|
Return CType(SerializerXml.Deserialize(s), TMicDocument)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicDocument 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicDocument object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicDocument 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 TMicDocument, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDocument)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicDocument) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicDocument
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicAttributes
|
|
|
|
#Region "Private fields"
|
|
Private _attribute As List(Of TMicAttribute)
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._attribute = New List(Of TMicAttribute)()
|
|
End Sub
|
|
|
|
<XmlElement("Attribute")>
|
|
Public Property Attribute() As List(Of TMicAttribute)
|
|
Get
|
|
Return Me._attribute
|
|
End Get
|
|
Set
|
|
Me._attribute = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAttributes))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicAttributes object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicAttributes object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicAttributes 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 TMicAttributes, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicAttributes)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicAttributes) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicAttributes
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicAttributes)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicAttributes
|
|
Return CType(SerializerXml.Deserialize(s), TMicAttributes)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicAttributes 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicAttributes object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicAttributes 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 TMicAttributes, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicAttributes)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicAttributes) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicAttributes
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicAttribute
|
|
|
|
#Region "Private fields"
|
|
Private _attrType As String
|
|
|
|
Private _attrText As String
|
|
|
|
Private _creationUser As String
|
|
|
|
Private _creationDate As Date
|
|
|
|
Private _modificationUser As String
|
|
|
|
Private _modificationDate As Date
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property attrType() As String
|
|
Get
|
|
Return Me._attrType
|
|
End Get
|
|
Set
|
|
Me._attrType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property attrText() As String
|
|
Get
|
|
Return Me._attrText
|
|
End Get
|
|
Set
|
|
Me._attrText = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationUser() As String
|
|
Get
|
|
Return Me._creationUser
|
|
End Get
|
|
Set
|
|
Me._creationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationDate() As Date
|
|
Get
|
|
Return Me._creationDate
|
|
End Get
|
|
Set
|
|
Me._creationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationUser() As String
|
|
Get
|
|
Return Me._modificationUser
|
|
End Get
|
|
Set
|
|
Me._modificationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationDate() As Date
|
|
Get
|
|
Return Me._modificationDate
|
|
End Get
|
|
Set
|
|
Me._modificationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAttribute))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicAttribute object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicAttribute object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicAttribute 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 TMicAttribute, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicAttribute)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicAttribute) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicAttribute
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicAttribute)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicAttribute
|
|
Return CType(SerializerXml.Deserialize(s), TMicAttribute)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicAttribute 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicAttribute object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicAttribute 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 TMicAttribute, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicAttribute)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicAttribute) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicAttribute
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicPartners
|
|
|
|
#Region "Private fields"
|
|
Private _partner As List(Of TMicPartner)
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._partner = New List(Of TMicPartner)()
|
|
End Sub
|
|
|
|
<XmlElement("Partner")>
|
|
Public Property Partner() As List(Of TMicPartner)
|
|
Get
|
|
Return Me._partner
|
|
End Get
|
|
Set
|
|
Me._partner = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPartners))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicPartners object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicPartners object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicPartners 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 TMicPartners, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicPartners)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicPartners) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicPartners
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicPartners)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicPartners
|
|
Return CType(SerializerXml.Deserialize(s), TMicPartners)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicPartners 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicPartners object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicPartners 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 TMicPartners, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicPartners)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicPartners) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicPartners
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicPartner
|
|
|
|
#Region "Private fields"
|
|
Private _partnerType As String
|
|
|
|
Private _partnerAddress As TMicAddress
|
|
|
|
Private _partnerRelation As String
|
|
|
|
Private _partnerInfo As String
|
|
|
|
Private _partnerTelephone As String
|
|
|
|
Private _creationUser As String
|
|
|
|
Private _creationDate As Date
|
|
|
|
Private _modificationUser As String
|
|
|
|
Private _modificationDate As Date
|
|
|
|
Private _partnerRole As String
|
|
|
|
Private _customerFields As TMicPartnerCustomerFields
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._customerFields = New TMicPartnerCustomerFields()
|
|
Me._partnerAddress = New TMicAddress()
|
|
End Sub
|
|
|
|
Public Property partnerType() As String
|
|
Get
|
|
Return Me._partnerType
|
|
End Get
|
|
Set
|
|
Me._partnerType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property PartnerAddress() As TMicAddress
|
|
Get
|
|
Return Me._partnerAddress
|
|
End Get
|
|
Set
|
|
Me._partnerAddress = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property partnerRelation() As String
|
|
Get
|
|
Return Me._partnerRelation
|
|
End Get
|
|
Set
|
|
Me._partnerRelation = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property partnerInfo() As String
|
|
Get
|
|
Return Me._partnerInfo
|
|
End Get
|
|
Set
|
|
Me._partnerInfo = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property partnerTelephone() As String
|
|
Get
|
|
Return Me._partnerTelephone
|
|
End Get
|
|
Set
|
|
Me._partnerTelephone = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationUser() As String
|
|
Get
|
|
Return Me._creationUser
|
|
End Get
|
|
Set
|
|
Me._creationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationDate() As Date
|
|
Get
|
|
Return Me._creationDate
|
|
End Get
|
|
Set
|
|
Me._creationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationUser() As String
|
|
Get
|
|
Return Me._modificationUser
|
|
End Get
|
|
Set
|
|
Me._modificationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationDate() As Date
|
|
Get
|
|
Return Me._modificationDate
|
|
End Get
|
|
Set
|
|
Me._modificationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property partnerRole() As String
|
|
Get
|
|
Return Me._partnerRole
|
|
End Get
|
|
Set
|
|
Me._partnerRole = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property CustomerFields() As TMicPartnerCustomerFields
|
|
Get
|
|
Return Me._customerFields
|
|
End Get
|
|
Set
|
|
Me._customerFields = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPartner))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicPartner object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicPartner object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicPartner 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 TMicPartner, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicPartner)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicPartner) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicPartner
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicPartner)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicPartner
|
|
Return CType(SerializerXml.Deserialize(s), TMicPartner)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicPartner 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicPartner object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicPartner 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 TMicPartner, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicPartner)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicPartner) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicPartner
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicPartnerCustomerFields
|
|
|
|
#Region "Private fields"
|
|
Private _text1 As String
|
|
|
|
Private _text2 As String
|
|
|
|
Private _text3 As String
|
|
|
|
Private _text4 As String
|
|
|
|
Private _text5 As String
|
|
|
|
Private _text6 As String
|
|
|
|
Private _text7 As String
|
|
|
|
Private _text8 As String
|
|
|
|
Private _text9 As String
|
|
|
|
Private _text10 As String
|
|
|
|
Private _date1 As Date
|
|
|
|
Private _date2 As Date
|
|
|
|
Private _date3 As Date
|
|
|
|
Private _date4 As Date
|
|
|
|
Private _date5 As Date
|
|
|
|
Private _date6 As Date
|
|
|
|
Private _date7 As Date
|
|
|
|
Private _date8 As Date
|
|
|
|
Private _date9 As Date
|
|
|
|
Private _date10 As Date
|
|
|
|
Private _flag1 As Boolean
|
|
|
|
Private _flag2 As Boolean
|
|
|
|
Private _flag3 As Boolean
|
|
|
|
Private _flag4 As Boolean
|
|
|
|
Private _flag5 As Boolean
|
|
|
|
Private _flag6 As Boolean
|
|
|
|
Private _flag7 As Boolean
|
|
|
|
Private _flag8 As Boolean
|
|
|
|
Private _flag9 As Boolean
|
|
|
|
Private _flag10 As Boolean
|
|
|
|
Private _number1 As Decimal
|
|
|
|
Private _number2 As Decimal
|
|
|
|
Private _number3 As Decimal
|
|
|
|
Private _number4 As Decimal
|
|
|
|
Private _number5 As Decimal
|
|
|
|
Private _number6 As Decimal
|
|
|
|
Private _number7 As Decimal
|
|
|
|
Private _number8 As Decimal
|
|
|
|
Private _number9 As Decimal
|
|
|
|
Private _number10 As Decimal
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property text1() As String
|
|
Get
|
|
Return Me._text1
|
|
End Get
|
|
Set
|
|
Me._text1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text2() As String
|
|
Get
|
|
Return Me._text2
|
|
End Get
|
|
Set
|
|
Me._text2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text3() As String
|
|
Get
|
|
Return Me._text3
|
|
End Get
|
|
Set
|
|
Me._text3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text4() As String
|
|
Get
|
|
Return Me._text4
|
|
End Get
|
|
Set
|
|
Me._text4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text5() As String
|
|
Get
|
|
Return Me._text5
|
|
End Get
|
|
Set
|
|
Me._text5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text6() As String
|
|
Get
|
|
Return Me._text6
|
|
End Get
|
|
Set
|
|
Me._text6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text7() As String
|
|
Get
|
|
Return Me._text7
|
|
End Get
|
|
Set
|
|
Me._text7 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text8() As String
|
|
Get
|
|
Return Me._text8
|
|
End Get
|
|
Set
|
|
Me._text8 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text9() As String
|
|
Get
|
|
Return Me._text9
|
|
End Get
|
|
Set
|
|
Me._text9 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text10() As String
|
|
Get
|
|
Return Me._text10
|
|
End Get
|
|
Set
|
|
Me._text10 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date1() As Date
|
|
Get
|
|
Return Me._date1
|
|
End Get
|
|
Set
|
|
Me._date1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date2() As Date
|
|
Get
|
|
Return Me._date2
|
|
End Get
|
|
Set
|
|
Me._date2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date3() As Date
|
|
Get
|
|
Return Me._date3
|
|
End Get
|
|
Set
|
|
Me._date3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date4() As Date
|
|
Get
|
|
Return Me._date4
|
|
End Get
|
|
Set
|
|
Me._date4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date5() As Date
|
|
Get
|
|
Return Me._date5
|
|
End Get
|
|
Set
|
|
Me._date5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date6() As Date
|
|
Get
|
|
Return Me._date6
|
|
End Get
|
|
Set
|
|
Me._date6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date7() As Date
|
|
Get
|
|
Return Me._date7
|
|
End Get
|
|
Set
|
|
Me._date7 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date8() As Date
|
|
Get
|
|
Return Me._date8
|
|
End Get
|
|
Set
|
|
Me._date8 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date9() As Date
|
|
Get
|
|
Return Me._date9
|
|
End Get
|
|
Set
|
|
Me._date9 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date10() As Date
|
|
Get
|
|
Return Me._date10
|
|
End Get
|
|
Set
|
|
Me._date10 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag1() As Boolean
|
|
Get
|
|
Return Me._flag1
|
|
End Get
|
|
Set
|
|
Me._flag1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag2() As Boolean
|
|
Get
|
|
Return Me._flag2
|
|
End Get
|
|
Set
|
|
Me._flag2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag3() As Boolean
|
|
Get
|
|
Return Me._flag3
|
|
End Get
|
|
Set
|
|
Me._flag3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag4() As Boolean
|
|
Get
|
|
Return Me._flag4
|
|
End Get
|
|
Set
|
|
Me._flag4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag5() As Boolean
|
|
Get
|
|
Return Me._flag5
|
|
End Get
|
|
Set
|
|
Me._flag5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag6() As Boolean
|
|
Get
|
|
Return Me._flag6
|
|
End Get
|
|
Set
|
|
Me._flag6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag7() As Boolean
|
|
Get
|
|
Return Me._flag7
|
|
End Get
|
|
Set
|
|
Me._flag7 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag8() As Boolean
|
|
Get
|
|
Return Me._flag8
|
|
End Get
|
|
Set
|
|
Me._flag8 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag9() As Boolean
|
|
Get
|
|
Return Me._flag9
|
|
End Get
|
|
Set
|
|
Me._flag9 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag10() As Boolean
|
|
Get
|
|
Return Me._flag10
|
|
End Get
|
|
Set
|
|
Me._flag10 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number1() As Decimal
|
|
Get
|
|
Return Me._number1
|
|
End Get
|
|
Set
|
|
Me._number1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number2() As Decimal
|
|
Get
|
|
Return Me._number2
|
|
End Get
|
|
Set
|
|
Me._number2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number3() As Decimal
|
|
Get
|
|
Return Me._number3
|
|
End Get
|
|
Set
|
|
Me._number3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number4() As Decimal
|
|
Get
|
|
Return Me._number4
|
|
End Get
|
|
Set
|
|
Me._number4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number5() As Decimal
|
|
Get
|
|
Return Me._number5
|
|
End Get
|
|
Set
|
|
Me._number5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number6() As Decimal
|
|
Get
|
|
Return Me._number6
|
|
End Get
|
|
Set
|
|
Me._number6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number7() As Decimal
|
|
Get
|
|
Return Me._number7
|
|
End Get
|
|
Set
|
|
Me._number7 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number8() As Decimal
|
|
Get
|
|
Return Me._number8
|
|
End Get
|
|
Set
|
|
Me._number8 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number9() As Decimal
|
|
Get
|
|
Return Me._number9
|
|
End Get
|
|
Set
|
|
Me._number9 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number10() As Decimal
|
|
Get
|
|
Return Me._number10
|
|
End Get
|
|
Set
|
|
Me._number10 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPartnerCustomerFields))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicPartnerCustomerFields object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicPartnerCustomerFields object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicPartnerCustomerFields 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 TMicPartnerCustomerFields, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicPartnerCustomerFields)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicPartnerCustomerFields) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicPartnerCustomerFields
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicPartnerCustomerFields)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicPartnerCustomerFields
|
|
Return CType(SerializerXml.Deserialize(s), TMicPartnerCustomerFields)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicPartnerCustomerFields 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicPartnerCustomerFields object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicPartnerCustomerFields 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 TMicPartnerCustomerFields, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicPartnerCustomerFields)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicPartnerCustomerFields) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicPartnerCustomerFields
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType(AnonymousType:=True, [Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicInvoiceLineEudr
|
|
|
|
#Region "Private fields"
|
|
Private _supplierNumber As String
|
|
|
|
Private _countryOfProduction As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property supplierNumber() As String
|
|
Get
|
|
Return Me._supplierNumber
|
|
End Get
|
|
Set
|
|
Me._supplierNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property countryOfProduction() As String
|
|
Get
|
|
Return Me._countryOfProduction
|
|
End Get
|
|
Set
|
|
Me._countryOfProduction = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInvoiceLineEudr))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicInvoiceLineEudr object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicInvoiceLineEudr object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicInvoiceLineEudr 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 TMicInvoiceLineEudr, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicInvoiceLineEudr)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicInvoiceLineEudr) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicInvoiceLineEudr
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInvoiceLineEudr)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicInvoiceLineEudr
|
|
Return CType(SerializerXml.Deserialize(s), TMicInvoiceLineEudr)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicInvoiceLineEudr 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicInvoiceLineEudr object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicInvoiceLineEudr 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 TMicInvoiceLineEudr, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicInvoiceLineEudr)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicInvoiceLineEudr) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicInvoiceLineEudr
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicInvoiceLines
|
|
|
|
#Region "Private fields"
|
|
Private _line As List(Of TMicInvoiceLine)
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._line = New List(Of TMicInvoiceLine)()
|
|
End Sub
|
|
|
|
<XmlElement("Line")>
|
|
Public Property Line() As List(Of TMicInvoiceLine)
|
|
Get
|
|
Return Me._line
|
|
End Get
|
|
Set
|
|
Me._line = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInvoiceLines))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicInvoiceLines object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicInvoiceLines object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicInvoiceLines 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 TMicInvoiceLines, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicInvoiceLines)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicInvoiceLines) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicInvoiceLines
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInvoiceLines)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicInvoiceLines
|
|
Return CType(SerializerXml.Deserialize(s), TMicInvoiceLines)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicInvoiceLines 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicInvoiceLines object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicInvoiceLines 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 TMicInvoiceLines, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicInvoiceLines)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicInvoiceLines) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicInvoiceLines
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicCustIntra
|
|
|
|
#Region "Private fields"
|
|
Private _vendorVatId As String
|
|
|
|
Private _statisticalProcedure As String
|
|
|
|
Private _internalReference As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property vendorVatId() As String
|
|
Get
|
|
Return Me._vendorVatId
|
|
End Get
|
|
Set
|
|
Me._vendorVatId = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property statisticalProcedure() As String
|
|
Get
|
|
Return Me._statisticalProcedure
|
|
End Get
|
|
Set
|
|
Me._statisticalProcedure = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property internalReference() As String
|
|
Get
|
|
Return Me._internalReference
|
|
End Get
|
|
Set
|
|
Me._internalReference = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicCustIntra))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicCustIntra object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicCustIntra object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicCustIntra 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 TMicCustIntra, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicCustIntra)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicCustIntra) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicCustIntra
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicCustIntra)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicCustIntra
|
|
Return CType(SerializerXml.Deserialize(s), TMicCustIntra)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicCustIntra 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicCustIntra object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicCustIntra 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 TMicCustIntra, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicCustIntra)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicCustIntra) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicCustIntra
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicAtlasCompletionSumDEntry
|
|
|
|
#Region "Private fields"
|
|
Private _idType As String
|
|
|
|
Private _quantity As Long
|
|
|
|
Private _packageType As String
|
|
|
|
Private _registrationNumber As String
|
|
|
|
Private _lineNumber As Long
|
|
|
|
Private _depositor As String
|
|
|
|
Private _spoType As String
|
|
|
|
Private _spo As String
|
|
|
|
Private _creationUser As String
|
|
|
|
Private _creationDate As Date
|
|
|
|
Private _modificationUser As String
|
|
|
|
Private _modificationDate As Date
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property idType() As String
|
|
Get
|
|
Return Me._idType
|
|
End Get
|
|
Set
|
|
Me._idType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property quantity() As Long
|
|
Get
|
|
Return Me._quantity
|
|
End Get
|
|
Set
|
|
Me._quantity = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property packageType() As String
|
|
Get
|
|
Return Me._packageType
|
|
End Get
|
|
Set
|
|
Me._packageType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property registrationNumber() As String
|
|
Get
|
|
Return Me._registrationNumber
|
|
End Get
|
|
Set
|
|
Me._registrationNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property lineNumber() As Long
|
|
Get
|
|
Return Me._lineNumber
|
|
End Get
|
|
Set
|
|
Me._lineNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property depositor() As String
|
|
Get
|
|
Return Me._depositor
|
|
End Get
|
|
Set
|
|
Me._depositor = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property spoType() As String
|
|
Get
|
|
Return Me._spoType
|
|
End Get
|
|
Set
|
|
Me._spoType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property spo() As String
|
|
Get
|
|
Return Me._spo
|
|
End Get
|
|
Set
|
|
Me._spo = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationUser() As String
|
|
Get
|
|
Return Me._creationUser
|
|
End Get
|
|
Set
|
|
Me._creationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationDate() As Date
|
|
Get
|
|
Return Me._creationDate
|
|
End Get
|
|
Set
|
|
Me._creationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationUser() As String
|
|
Get
|
|
Return Me._modificationUser
|
|
End Get
|
|
Set
|
|
Me._modificationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationDate() As Date
|
|
Get
|
|
Return Me._modificationDate
|
|
End Get
|
|
Set
|
|
Me._modificationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAtlasCompletionSumDEntry))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicAtlasCompletionSumDEntry object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicAtlasCompletionSumDEntry object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicAtlasCompletionSumDEntry 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 TMicAtlasCompletionSumDEntry, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicAtlasCompletionSumDEntry)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicAtlasCompletionSumDEntry) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicAtlasCompletionSumDEntry
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicAtlasCompletionSumDEntry)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicAtlasCompletionSumDEntry
|
|
Return CType(SerializerXml.Deserialize(s), TMicAtlasCompletionSumDEntry)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicAtlasCompletionSumDEntry 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicAtlasCompletionSumDEntry object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicAtlasCompletionSumDEntry 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 TMicAtlasCompletionSumDEntry, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicAtlasCompletionSumDEntry)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicAtlasCompletionSumDEntry) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicAtlasCompletionSumDEntry
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicAtlasCompletionSumD
|
|
|
|
#Region "Private fields"
|
|
Private _atlasCompletionSumD As List(Of TMicAtlasCompletionSumDEntry)
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._atlasCompletionSumD = New List(Of TMicAtlasCompletionSumDEntry)()
|
|
End Sub
|
|
|
|
<XmlElement("AtlasCompletionSumD")>
|
|
Public Property AtlasCompletionSumD() As List(Of TMicAtlasCompletionSumDEntry)
|
|
Get
|
|
Return Me._atlasCompletionSumD
|
|
End Get
|
|
Set
|
|
Me._atlasCompletionSumD = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAtlasCompletionSumD))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicAtlasCompletionSumD object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicAtlasCompletionSumD object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicAtlasCompletionSumD 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 TMicAtlasCompletionSumD, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicAtlasCompletionSumD)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicAtlasCompletionSumD) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicAtlasCompletionSumD
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicAtlasCompletionSumD)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicAtlasCompletionSumD
|
|
Return CType(SerializerXml.Deserialize(s), TMicAtlasCompletionSumD)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicAtlasCompletionSumD 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicAtlasCompletionSumD object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicAtlasCompletionSumD 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 TMicAtlasCompletionSumD, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicAtlasCompletionSumD)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicAtlasCompletionSumD) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicAtlasCompletionSumD
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicContainer
|
|
|
|
#Region "Private fields"
|
|
Private _containerIndicator As String
|
|
|
|
Private _containerNumber As String
|
|
|
|
Private _containerType As String
|
|
|
|
Private _containerLCLIndicator As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property containerIndicator() As String
|
|
Get
|
|
Return Me._containerIndicator
|
|
End Get
|
|
Set
|
|
Me._containerIndicator = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property containerNumber() As String
|
|
Get
|
|
Return Me._containerNumber
|
|
End Get
|
|
Set
|
|
Me._containerNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property containerType() As String
|
|
Get
|
|
Return Me._containerType
|
|
End Get
|
|
Set
|
|
Me._containerType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property containerLCLIndicator() As String
|
|
Get
|
|
Return Me._containerLCLIndicator
|
|
End Get
|
|
Set
|
|
Me._containerLCLIndicator = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicContainer))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicContainer object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicContainer object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicContainer 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 TMicContainer, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicContainer)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicContainer) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicContainer
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicContainer)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicContainer
|
|
Return CType(SerializerXml.Deserialize(s), TMicContainer)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicContainer 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicContainer object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicContainer 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 TMicContainer, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicContainer)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicContainer) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicContainer
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicImportCustomerFields
|
|
|
|
#Region "Private fields"
|
|
Private _text1 As String
|
|
|
|
Private _text2 As String
|
|
|
|
Private _text3 As String
|
|
|
|
Private _text4 As String
|
|
|
|
Private _text5 As String
|
|
|
|
Private _text6 As String
|
|
|
|
Private _text7 As String
|
|
|
|
Private _text8 As String
|
|
|
|
Private _text9 As String
|
|
|
|
Private _text10 As String
|
|
|
|
Private _date1 As Date
|
|
|
|
Private _date2 As Date
|
|
|
|
Private _date3 As Date
|
|
|
|
Private _date4 As Date
|
|
|
|
Private _date5 As Date
|
|
|
|
Private _date6 As Date
|
|
|
|
Private _date7 As Date
|
|
|
|
Private _date8 As Date
|
|
|
|
Private _date9 As Date
|
|
|
|
Private _date10 As Date
|
|
|
|
Private _flag1 As Boolean
|
|
|
|
Private _flag2 As Boolean
|
|
|
|
Private _flag3 As Boolean
|
|
|
|
Private _flag4 As Boolean
|
|
|
|
Private _flag5 As Boolean
|
|
|
|
Private _flag6 As Boolean
|
|
|
|
Private _flag7 As Boolean
|
|
|
|
Private _flag8 As Boolean
|
|
|
|
Private _flag9 As Boolean
|
|
|
|
Private _flag10 As Boolean
|
|
|
|
Private _number1 As Decimal
|
|
|
|
Private _number2 As Decimal
|
|
|
|
Private _number3 As Decimal
|
|
|
|
Private _number4 As Decimal
|
|
|
|
Private _number5 As Decimal
|
|
|
|
Private _number6 As Decimal
|
|
|
|
Private _number7 As Decimal
|
|
|
|
Private _number8 As Decimal
|
|
|
|
Private _number9 As Decimal
|
|
|
|
Private _number10 As Decimal
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property text1() As String
|
|
Get
|
|
Return Me._text1
|
|
End Get
|
|
Set
|
|
Me._text1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text2() As String
|
|
Get
|
|
Return Me._text2
|
|
End Get
|
|
Set
|
|
Me._text2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text3() As String
|
|
Get
|
|
Return Me._text3
|
|
End Get
|
|
Set
|
|
Me._text3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text4() As String
|
|
Get
|
|
Return Me._text4
|
|
End Get
|
|
Set
|
|
Me._text4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text5() As String
|
|
Get
|
|
Return Me._text5
|
|
End Get
|
|
Set
|
|
Me._text5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text6() As String
|
|
Get
|
|
Return Me._text6
|
|
End Get
|
|
Set
|
|
Me._text6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text7() As String
|
|
Get
|
|
Return Me._text7
|
|
End Get
|
|
Set
|
|
Me._text7 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text8() As String
|
|
Get
|
|
Return Me._text8
|
|
End Get
|
|
Set
|
|
Me._text8 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text9() As String
|
|
Get
|
|
Return Me._text9
|
|
End Get
|
|
Set
|
|
Me._text9 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text10() As String
|
|
Get
|
|
Return Me._text10
|
|
End Get
|
|
Set
|
|
Me._text10 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date1() As Date
|
|
Get
|
|
Return Me._date1
|
|
End Get
|
|
Set
|
|
Me._date1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date2() As Date
|
|
Get
|
|
Return Me._date2
|
|
End Get
|
|
Set
|
|
Me._date2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date3() As Date
|
|
Get
|
|
Return Me._date3
|
|
End Get
|
|
Set
|
|
Me._date3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date4() As Date
|
|
Get
|
|
Return Me._date4
|
|
End Get
|
|
Set
|
|
Me._date4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date5() As Date
|
|
Get
|
|
Return Me._date5
|
|
End Get
|
|
Set
|
|
Me._date5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date6() As Date
|
|
Get
|
|
Return Me._date6
|
|
End Get
|
|
Set
|
|
Me._date6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date7() As Date
|
|
Get
|
|
Return Me._date7
|
|
End Get
|
|
Set
|
|
Me._date7 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date8() As Date
|
|
Get
|
|
Return Me._date8
|
|
End Get
|
|
Set
|
|
Me._date8 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date9() As Date
|
|
Get
|
|
Return Me._date9
|
|
End Get
|
|
Set
|
|
Me._date9 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property date10() As Date
|
|
Get
|
|
Return Me._date10
|
|
End Get
|
|
Set
|
|
Me._date10 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag1() As Boolean
|
|
Get
|
|
Return Me._flag1
|
|
End Get
|
|
Set
|
|
Me._flag1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag2() As Boolean
|
|
Get
|
|
Return Me._flag2
|
|
End Get
|
|
Set
|
|
Me._flag2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag3() As Boolean
|
|
Get
|
|
Return Me._flag3
|
|
End Get
|
|
Set
|
|
Me._flag3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag4() As Boolean
|
|
Get
|
|
Return Me._flag4
|
|
End Get
|
|
Set
|
|
Me._flag4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag5() As Boolean
|
|
Get
|
|
Return Me._flag5
|
|
End Get
|
|
Set
|
|
Me._flag5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag6() As Boolean
|
|
Get
|
|
Return Me._flag6
|
|
End Get
|
|
Set
|
|
Me._flag6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag7() As Boolean
|
|
Get
|
|
Return Me._flag7
|
|
End Get
|
|
Set
|
|
Me._flag7 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag8() As Boolean
|
|
Get
|
|
Return Me._flag8
|
|
End Get
|
|
Set
|
|
Me._flag8 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag9() As Boolean
|
|
Get
|
|
Return Me._flag9
|
|
End Get
|
|
Set
|
|
Me._flag9 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property flag10() As Boolean
|
|
Get
|
|
Return Me._flag10
|
|
End Get
|
|
Set
|
|
Me._flag10 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number1() As Decimal
|
|
Get
|
|
Return Me._number1
|
|
End Get
|
|
Set
|
|
Me._number1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number2() As Decimal
|
|
Get
|
|
Return Me._number2
|
|
End Get
|
|
Set
|
|
Me._number2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number3() As Decimal
|
|
Get
|
|
Return Me._number3
|
|
End Get
|
|
Set
|
|
Me._number3 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number4() As Decimal
|
|
Get
|
|
Return Me._number4
|
|
End Get
|
|
Set
|
|
Me._number4 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number5() As Decimal
|
|
Get
|
|
Return Me._number5
|
|
End Get
|
|
Set
|
|
Me._number5 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number6() As Decimal
|
|
Get
|
|
Return Me._number6
|
|
End Get
|
|
Set
|
|
Me._number6 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number7() As Decimal
|
|
Get
|
|
Return Me._number7
|
|
End Get
|
|
Set
|
|
Me._number7 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number8() As Decimal
|
|
Get
|
|
Return Me._number8
|
|
End Get
|
|
Set
|
|
Me._number8 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number9() As Decimal
|
|
Get
|
|
Return Me._number9
|
|
End Get
|
|
Set
|
|
Me._number9 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property number10() As Decimal
|
|
Get
|
|
Return Me._number10
|
|
End Get
|
|
Set
|
|
Me._number10 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicImportCustomerFields))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicImportCustomerFields object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicImportCustomerFields object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicImportCustomerFields 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 TMicImportCustomerFields, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicImportCustomerFields)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicImportCustomerFields) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicImportCustomerFields
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicImportCustomerFields)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicImportCustomerFields
|
|
Return CType(SerializerXml.Deserialize(s), TMicImportCustomerFields)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicImportCustomerFields 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicImportCustomerFields object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicImportCustomerFields 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 TMicImportCustomerFields, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicImportCustomerFields)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicImportCustomerFields) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicImportCustomerFields
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicImportPaymentInfo
|
|
|
|
#Region "Private fields"
|
|
Private _paymentType As String
|
|
|
|
Private _paymentDate As Date
|
|
|
|
Private _paymentBankCode As String
|
|
|
|
Private _paymentBankBranchCode As String
|
|
|
|
Private _paymentCurrency As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property paymentType() As String
|
|
Get
|
|
Return Me._paymentType
|
|
End Get
|
|
Set
|
|
Me._paymentType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property paymentDate() As Date
|
|
Get
|
|
Return Me._paymentDate
|
|
End Get
|
|
Set
|
|
Me._paymentDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property paymentBankCode() As String
|
|
Get
|
|
Return Me._paymentBankCode
|
|
End Get
|
|
Set
|
|
Me._paymentBankCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property paymentBankBranchCode() As String
|
|
Get
|
|
Return Me._paymentBankBranchCode
|
|
End Get
|
|
Set
|
|
Me._paymentBankBranchCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property paymentCurrency() As String
|
|
Get
|
|
Return Me._paymentCurrency
|
|
End Get
|
|
Set
|
|
Me._paymentCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicImportPaymentInfo))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicImportPaymentInfo object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicImportPaymentInfo object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicImportPaymentInfo 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 TMicImportPaymentInfo, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicImportPaymentInfo)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicImportPaymentInfo) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicImportPaymentInfo
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicImportPaymentInfo)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicImportPaymentInfo
|
|
Return CType(SerializerXml.Deserialize(s), TMicImportPaymentInfo)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicImportPaymentInfo 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicImportPaymentInfo object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicImportPaymentInfo 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 TMicImportPaymentInfo, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicImportPaymentInfo)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicImportPaymentInfo) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicImportPaymentInfo
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicInsuranceCostsInv
|
|
|
|
#Region "Private fields"
|
|
Private _insAmount As Decimal
|
|
|
|
Private _insCurrency As String
|
|
|
|
Private _insProRating As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property insAmount() As Decimal
|
|
Get
|
|
Return Me._insAmount
|
|
End Get
|
|
Set
|
|
Me._insAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property insCurrency() As String
|
|
Get
|
|
Return Me._insCurrency
|
|
End Get
|
|
Set
|
|
Me._insCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property insProRating() As String
|
|
Get
|
|
Return Me._insProRating
|
|
End Get
|
|
Set
|
|
Me._insProRating = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInsuranceCostsInv))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicInsuranceCostsInv object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicInsuranceCostsInv object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicInsuranceCostsInv 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 TMicInsuranceCostsInv, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicInsuranceCostsInv)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicInsuranceCostsInv) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicInsuranceCostsInv
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInsuranceCostsInv)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicInsuranceCostsInv
|
|
Return CType(SerializerXml.Deserialize(s), TMicInsuranceCostsInv)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicInsuranceCostsInv 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicInsuranceCostsInv object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicInsuranceCostsInv 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 TMicInsuranceCostsInv, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicInsuranceCostsInv)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicInsuranceCostsInv) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicInsuranceCostsInv
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicFreightCostsInv
|
|
|
|
#Region "Private fields"
|
|
Private _frtAmount As Decimal
|
|
|
|
Private _frtCurrency As String
|
|
|
|
Private _frtInternational As Decimal
|
|
|
|
Private _frtEuNational As Decimal
|
|
|
|
Private _frtInland As Decimal
|
|
|
|
Private _frtProRating As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property frtAmount() As Decimal
|
|
Get
|
|
Return Me._frtAmount
|
|
End Get
|
|
Set
|
|
Me._frtAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property frtCurrency() As String
|
|
Get
|
|
Return Me._frtCurrency
|
|
End Get
|
|
Set
|
|
Me._frtCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property frtInternational() As Decimal
|
|
Get
|
|
Return Me._frtInternational
|
|
End Get
|
|
Set
|
|
Me._frtInternational = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property frtEuNational() As Decimal
|
|
Get
|
|
Return Me._frtEuNational
|
|
End Get
|
|
Set
|
|
Me._frtEuNational = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property frtInland() As Decimal
|
|
Get
|
|
Return Me._frtInland
|
|
End Get
|
|
Set
|
|
Me._frtInland = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property frtProRating() As String
|
|
Get
|
|
Return Me._frtProRating
|
|
End Get
|
|
Set
|
|
Me._frtProRating = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicFreightCostsInv))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicFreightCostsInv object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicFreightCostsInv object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicFreightCostsInv 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 TMicFreightCostsInv, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicFreightCostsInv)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicFreightCostsInv) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicFreightCostsInv
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicFreightCostsInv)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicFreightCostsInv
|
|
Return CType(SerializerXml.Deserialize(s), TMicFreightCostsInv)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicFreightCostsInv 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicFreightCostsInv object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicFreightCostsInv 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 TMicFreightCostsInv, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicFreightCostsInv)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicFreightCostsInv) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicFreightCostsInv
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicRebate
|
|
|
|
#Region "Private fields"
|
|
Private _rebAmount As Decimal
|
|
|
|
Private _rebCurrency As String
|
|
|
|
Private _rebProRating As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property rebAmount() As Decimal
|
|
Get
|
|
Return Me._rebAmount
|
|
End Get
|
|
Set
|
|
Me._rebAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property rebCurrency() As String
|
|
Get
|
|
Return Me._rebCurrency
|
|
End Get
|
|
Set
|
|
Me._rebCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property rebProRating() As String
|
|
Get
|
|
Return Me._rebProRating
|
|
End Get
|
|
Set
|
|
Me._rebProRating = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicRebate))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicRebate object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicRebate object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicRebate 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 TMicRebate, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicRebate)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicRebate) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicRebate
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicRebate)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicRebate
|
|
Return CType(SerializerXml.Deserialize(s), TMicRebate)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicRebate 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicRebate object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicRebate 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 TMicRebate, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicRebate)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicRebate) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicRebate
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicDelTerm
|
|
|
|
#Region "Private fields"
|
|
Private _code As String
|
|
|
|
Private _desc As String
|
|
|
|
Private _calculationOfFreightCosts As String
|
|
|
|
Private _code2 As String
|
|
|
|
Private _text As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property code() As String
|
|
Get
|
|
Return Me._code
|
|
End Get
|
|
Set
|
|
Me._code = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property desc() As String
|
|
Get
|
|
Return Me._desc
|
|
End Get
|
|
Set
|
|
Me._desc = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property calculationOfFreightCosts() As String
|
|
Get
|
|
Return Me._calculationOfFreightCosts
|
|
End Get
|
|
Set
|
|
Me._calculationOfFreightCosts = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property code2() As String
|
|
Get
|
|
Return Me._code2
|
|
End Get
|
|
Set
|
|
Me._code2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text() As String
|
|
Get
|
|
Return Me._text
|
|
End Get
|
|
Set
|
|
Me._text = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDelTerm))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicDelTerm object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicDelTerm object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicDelTerm 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 TMicDelTerm, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDelTerm)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicDelTerm) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicDelTerm
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDelTerm)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicDelTerm
|
|
Return CType(SerializerXml.Deserialize(s), TMicDelTerm)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicDelTerm 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicDelTerm object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicDelTerm 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 TMicDelTerm, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDelTerm)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicDelTerm) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicDelTerm
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType(AnonymousType:=True, [Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0"),
|
|
XmlRoot([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0", IsNullable:=False)>
|
|
Partial Public Class MicCustImportMessage
|
|
|
|
#Region "Private fields"
|
|
Private _shipment As TMicShipment
|
|
|
|
Private _invoice As List(Of TMicInvoice)
|
|
|
|
Private _cancellation As TMicCancellation
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._cancellation = New TMicCancellation()
|
|
Me._invoice = New List(Of TMicInvoice)()
|
|
Me._shipment = New TMicShipment()
|
|
End Sub
|
|
|
|
Public Property Shipment() As TMicShipment
|
|
Get
|
|
Return Me._shipment
|
|
End Get
|
|
Set
|
|
Me._shipment = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("Invoice")>
|
|
Public Property Invoice() As List(Of TMicInvoice)
|
|
Get
|
|
Return Me._invoice
|
|
End Get
|
|
Set
|
|
Me._invoice = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Cancellation() As TMicCancellation
|
|
Get
|
|
Return Me._cancellation
|
|
End Get
|
|
Set
|
|
Me._cancellation = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(MicCustImportMessage))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize MicCustImportMessage object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 MicCustImportMessage object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output MicCustImportMessage 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 MicCustImportMessage, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, MicCustImportMessage)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As MicCustImportMessage) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As MicCustImportMessage
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), MicCustImportMessage)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As MicCustImportMessage
|
|
Return CType(SerializerXml.Deserialize(s), MicCustImportMessage)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current MicCustImportMessage 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 MicCustImportMessage object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output MicCustImportMessage 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 MicCustImportMessage, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, MicCustImportMessage)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As MicCustImportMessage) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As MicCustImportMessage
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicShipment
|
|
|
|
#Region "Private fields"
|
|
Private _company As String
|
|
|
|
Private _plant As String
|
|
|
|
Private _shipmentId As String
|
|
|
|
Private _shipmentPartial As String
|
|
|
|
Private _shipmentVersion As String
|
|
|
|
Private _documentNumber As Decimal
|
|
|
|
Private _shipmentHead As TMicShipmentHead
|
|
|
|
Private _containers As TMicContainerInfo
|
|
|
|
Private _documents As TMicDocuments
|
|
|
|
Private _attributes As TMicAttributes
|
|
|
|
Private _partners As TMicPartners
|
|
|
|
Private _previousDocuments As TMicPreviousDocuments
|
|
|
|
Private _atlasCompletionSumDs As TMicAtlasCompletionSumD
|
|
|
|
Private _additionalInformation As TMicAttributes
|
|
|
|
Private _authorisationHolders As TMicAuthHolders
|
|
|
|
Private _defermentAccounts As TMicDeferAccs
|
|
|
|
Private _guarantees As TMicGuarantees
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._guarantees = New TMicGuarantees()
|
|
Me._defermentAccounts = New TMicDeferAccs()
|
|
Me._authorisationHolders = New TMicAuthHolders()
|
|
Me._additionalInformation = New TMicAttributes()
|
|
Me._atlasCompletionSumDs = New TMicAtlasCompletionSumD()
|
|
Me._previousDocuments = New TMicPreviousDocuments()
|
|
Me._partners = New TMicPartners()
|
|
Me._attributes = New TMicAttributes()
|
|
Me._documents = New TMicDocuments()
|
|
Me._containers = New TMicContainerInfo()
|
|
Me._shipmentHead = New TMicShipmentHead()
|
|
Me._shipmentVersion = "1"
|
|
Me._documentNumber = CType(1D, Decimal)
|
|
End Sub
|
|
|
|
Public Property company() As String
|
|
Get
|
|
Return Me._company
|
|
End Get
|
|
Set
|
|
Me._company = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property plant() As String
|
|
Get
|
|
Return Me._plant
|
|
End Get
|
|
Set
|
|
Me._plant = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property shipmentId() As String
|
|
Get
|
|
Return Me._shipmentId
|
|
End Get
|
|
Set
|
|
Me._shipmentId = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property shipmentPartial() As String
|
|
Get
|
|
Return Me._shipmentPartial
|
|
End Get
|
|
Set
|
|
Me._shipmentPartial = Value
|
|
End Set
|
|
End Property
|
|
|
|
<System.ComponentModel.DefaultValue("1")>
|
|
Public Property shipmentVersion() As String
|
|
Get
|
|
Return Me._shipmentVersion
|
|
End Get
|
|
Set
|
|
Me._shipmentVersion = Value
|
|
End Set
|
|
End Property
|
|
|
|
<System.ComponentModel.DefaultValue(GetType(Decimal), "1")>
|
|
Public Property documentNumber() As Decimal
|
|
Get
|
|
Return Me._documentNumber
|
|
End Get
|
|
Set
|
|
Me._documentNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ShipmentHead() As TMicShipmentHead
|
|
Get
|
|
Return Me._shipmentHead
|
|
End Get
|
|
Set
|
|
Me._shipmentHead = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Containers() As TMicContainerInfo
|
|
Get
|
|
Return Me._containers
|
|
End Get
|
|
Set
|
|
Me._containers = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Documents() As TMicDocuments
|
|
Get
|
|
Return Me._documents
|
|
End Get
|
|
Set
|
|
Me._documents = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Attributes() As TMicAttributes
|
|
Get
|
|
Return Me._attributes
|
|
End Get
|
|
Set
|
|
Me._attributes = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Partners() As TMicPartners
|
|
Get
|
|
Return Me._partners
|
|
End Get
|
|
Set
|
|
Me._partners = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property PreviousDocuments() As TMicPreviousDocuments
|
|
Get
|
|
Return Me._previousDocuments
|
|
End Get
|
|
Set
|
|
Me._previousDocuments = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property AtlasCompletionSumDs() As TMicAtlasCompletionSumD
|
|
Get
|
|
Return Me._atlasCompletionSumDs
|
|
End Get
|
|
Set
|
|
Me._atlasCompletionSumDs = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property AdditionalInformation() As TMicAttributes
|
|
Get
|
|
Return Me._additionalInformation
|
|
End Get
|
|
Set
|
|
Me._additionalInformation = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property AuthorisationHolders() As TMicAuthHolders
|
|
Get
|
|
Return Me._authorisationHolders
|
|
End Get
|
|
Set
|
|
Me._authorisationHolders = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property DefermentAccounts() As TMicDeferAccs
|
|
Get
|
|
Return Me._defermentAccounts
|
|
End Get
|
|
Set
|
|
Me._defermentAccounts = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Guarantees() As TMicGuarantees
|
|
Get
|
|
Return Me._guarantees
|
|
End Get
|
|
Set
|
|
Me._guarantees = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicShipment))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicShipment object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicShipment object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicShipment 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 TMicShipment, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicShipment)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicShipment) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicShipment
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicShipment)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicShipment
|
|
Return CType(SerializerXml.Deserialize(s), TMicShipment)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicShipment 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicShipment object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicShipment 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 TMicShipment, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicShipment)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicShipment) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicShipment
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicShipmentHead
|
|
|
|
#Region "Private fields"
|
|
Private _shipmentType As TMicShipmentHeadShipmentType
|
|
|
|
Private _customsDate As Date
|
|
|
|
Private _declType As TMicDeclType
|
|
|
|
Private _mrn As String
|
|
|
|
Private _grossWeight As Decimal
|
|
|
|
Private _departurePlace As String
|
|
|
|
Private _dispatchCountry As String
|
|
|
|
Private _lastDispatchCountry As String
|
|
|
|
Private _destinationPlace As String
|
|
|
|
Private _destinationRegion As String
|
|
|
|
Private _officeEntry As String
|
|
|
|
Private _importState As String
|
|
|
|
Private _substituteFlag As String
|
|
|
|
Private _typeOfImport As String
|
|
|
|
Private _authorizationNumber As String
|
|
|
|
Private _placeOfDispatchDescription As String
|
|
|
|
Private _typeOfAirTransportation As String
|
|
|
|
Private _code1 As String
|
|
|
|
Private _motBorder As TMicMot
|
|
|
|
Private _motBorderCrossing As TMicMot
|
|
|
|
Private _motInland As TMicMot
|
|
|
|
Private _containerIndicator As String
|
|
|
|
Private _container As TMicContainer
|
|
|
|
Private _freight As TMicFreightCosts
|
|
|
|
Private _insurance As TMicInsuranceCosts
|
|
|
|
Private _additionalCosts As List(Of TMicAdditionalCosts)
|
|
|
|
Private _additionalCostVAT As Decimal
|
|
|
|
Private _text As String
|
|
|
|
Private _exportDate As Date
|
|
|
|
Private _importDate As Date
|
|
|
|
Private _estArrivalDate As Date
|
|
|
|
Private _partyConst As String
|
|
|
|
Private _period As String
|
|
|
|
Private _customerFields As TMicImportCustomerFields
|
|
|
|
Private _countryDestination As String
|
|
|
|
Private _clearenceType As String
|
|
|
|
Private _previousDocType As String
|
|
|
|
Private _previousDocNumber As String
|
|
|
|
Private _customsOfficeOfDestination As String
|
|
|
|
Private _carrierNumber As String
|
|
|
|
Private _creationUser As String
|
|
|
|
Private _creationDate As Date
|
|
|
|
Private _modificationUser As String
|
|
|
|
Private _modificationDate As Date
|
|
|
|
Private _supervisingOffice As String
|
|
|
|
Private _typeIdentificationOfTransportArrival As String
|
|
|
|
Private _portInspectionOrganizationCode As String
|
|
|
|
Private _licensingOrganizationCode As String
|
|
|
|
Private _goodsLocation As String
|
|
|
|
Private _destinationPort As String
|
|
|
|
Private _entryPort As String
|
|
|
|
Private _departurePort As String
|
|
|
|
Private _destinationInspectionOrganizationCode As String
|
|
|
|
Private _receivingOrganizationCode As String
|
|
|
|
Private _arrivalMeansType As String
|
|
|
|
Private _arrivalMeansIdNo As String
|
|
|
|
Private _additionalStatisticalCurrency As String
|
|
|
|
Private _additionalStatisticalValue As Decimal
|
|
|
|
Private _broker As String
|
|
|
|
Private _waybillNumber As String
|
|
|
|
Private _waybillDate As Date
|
|
|
|
Private _houseWaybillNumber As String
|
|
|
|
Private _houseWaybillDate As Date
|
|
|
|
Private _locGoods As TMicLocationOfGoods
|
|
|
|
Private _deferredPayment As String
|
|
|
|
Private _presentationsCustomsOffice As String
|
|
|
|
Private _paymentType As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._locGoods = New TMicLocationOfGoods()
|
|
Me._customerFields = New TMicImportCustomerFields()
|
|
Me._additionalCosts = New List(Of TMicAdditionalCosts)()
|
|
Me._insurance = New TMicInsuranceCosts()
|
|
Me._freight = New TMicFreightCosts()
|
|
Me._container = New TMicContainer()
|
|
Me._motInland = New TMicMot()
|
|
Me._motBorderCrossing = New TMicMot()
|
|
Me._motBorder = New TMicMot()
|
|
Me._declType = New TMicDeclType()
|
|
Me._shipmentType = TMicShipmentHeadShipmentType.E
|
|
Me._containerIndicator = "0"
|
|
End Sub
|
|
|
|
<System.ComponentModel.DefaultValue(TMicShipmentHeadShipmentType.E)>
|
|
Public Property shipmentType() As TMicShipmentHeadShipmentType
|
|
Get
|
|
Return Me._shipmentType
|
|
End Get
|
|
Set
|
|
Me._shipmentType = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property customsDate() As Date
|
|
Get
|
|
Return Me._customsDate
|
|
End Get
|
|
Set
|
|
Me._customsDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property declType() As TMicDeclType
|
|
Get
|
|
Return Me._declType
|
|
End Get
|
|
Set
|
|
Me._declType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property mrn() As String
|
|
Get
|
|
Return Me._mrn
|
|
End Get
|
|
Set
|
|
Me._mrn = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property grossWeight() As Decimal
|
|
Get
|
|
Return Me._grossWeight
|
|
End Get
|
|
Set
|
|
Me._grossWeight = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property departurePlace() As String
|
|
Get
|
|
Return Me._departurePlace
|
|
End Get
|
|
Set
|
|
Me._departurePlace = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property dispatchCountry() As String
|
|
Get
|
|
Return Me._dispatchCountry
|
|
End Get
|
|
Set
|
|
Me._dispatchCountry = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property lastDispatchCountry() As String
|
|
Get
|
|
Return Me._lastDispatchCountry
|
|
End Get
|
|
Set
|
|
Me._lastDispatchCountry = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property destinationPlace() As String
|
|
Get
|
|
Return Me._destinationPlace
|
|
End Get
|
|
Set
|
|
Me._destinationPlace = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property destinationRegion() As String
|
|
Get
|
|
Return Me._destinationRegion
|
|
End Get
|
|
Set
|
|
Me._destinationRegion = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property officeEntry() As String
|
|
Get
|
|
Return Me._officeEntry
|
|
End Get
|
|
Set
|
|
Me._officeEntry = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property importState() As String
|
|
Get
|
|
Return Me._importState
|
|
End Get
|
|
Set
|
|
Me._importState = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property substituteFlag() As String
|
|
Get
|
|
Return Me._substituteFlag
|
|
End Get
|
|
Set
|
|
Me._substituteFlag = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property typeOfImport() As String
|
|
Get
|
|
Return Me._typeOfImport
|
|
End Get
|
|
Set
|
|
Me._typeOfImport = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property authorizationNumber() As String
|
|
Get
|
|
Return Me._authorizationNumber
|
|
End Get
|
|
Set
|
|
Me._authorizationNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property placeOfDispatchDescription() As String
|
|
Get
|
|
Return Me._placeOfDispatchDescription
|
|
End Get
|
|
Set
|
|
Me._placeOfDispatchDescription = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property typeOfAirTransportation() As String
|
|
Get
|
|
Return Me._typeOfAirTransportation
|
|
End Get
|
|
Set
|
|
Me._typeOfAirTransportation = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property code1() As String
|
|
Get
|
|
Return Me._code1
|
|
End Get
|
|
Set
|
|
Me._code1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property MotBorder() As TMicMot
|
|
Get
|
|
Return Me._motBorder
|
|
End Get
|
|
Set
|
|
Me._motBorder = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property MotBorderCrossing() As TMicMot
|
|
Get
|
|
Return Me._motBorderCrossing
|
|
End Get
|
|
Set
|
|
Me._motBorderCrossing = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property MotInland() As TMicMot
|
|
Get
|
|
Return Me._motInland
|
|
End Get
|
|
Set
|
|
Me._motInland = Value
|
|
End Set
|
|
End Property
|
|
|
|
<System.ComponentModel.DefaultValue("0")>
|
|
Public Property containerIndicator() As String
|
|
Get
|
|
Return Me._containerIndicator
|
|
End Get
|
|
Set
|
|
Me._containerIndicator = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Container() As TMicContainer
|
|
Get
|
|
Return Me._container
|
|
End Get
|
|
Set
|
|
Me._container = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Freight() As TMicFreightCosts
|
|
Get
|
|
Return Me._freight
|
|
End Get
|
|
Set
|
|
Me._freight = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Insurance() As TMicInsuranceCosts
|
|
Get
|
|
Return Me._insurance
|
|
End Get
|
|
Set
|
|
Me._insurance = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement("AdditionalCosts")>
|
|
Public Property AdditionalCosts() As List(Of TMicAdditionalCosts)
|
|
Get
|
|
Return Me._additionalCosts
|
|
End Get
|
|
Set
|
|
Me._additionalCosts = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalCostVAT() As Decimal
|
|
Get
|
|
Return Me._additionalCostVAT
|
|
End Get
|
|
Set
|
|
Me._additionalCostVAT = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property text() As String
|
|
Get
|
|
Return Me._text
|
|
End Get
|
|
Set
|
|
Me._text = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property exportDate() As Date
|
|
Get
|
|
Return Me._exportDate
|
|
End Get
|
|
Set
|
|
Me._exportDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property importDate() As Date
|
|
Get
|
|
Return Me._importDate
|
|
End Get
|
|
Set
|
|
Me._importDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property estArrivalDate() As Date
|
|
Get
|
|
Return Me._estArrivalDate
|
|
End Get
|
|
Set
|
|
Me._estArrivalDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property partyConst() As String
|
|
Get
|
|
Return Me._partyConst
|
|
End Get
|
|
Set
|
|
Me._partyConst = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property period() As String
|
|
Get
|
|
Return Me._period
|
|
End Get
|
|
Set
|
|
Me._period = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property CustomerFields() As TMicImportCustomerFields
|
|
Get
|
|
Return Me._customerFields
|
|
End Get
|
|
Set
|
|
Me._customerFields = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property countryDestination() As String
|
|
Get
|
|
Return Me._countryDestination
|
|
End Get
|
|
Set
|
|
Me._countryDestination = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property clearenceType() As String
|
|
Get
|
|
Return Me._clearenceType
|
|
End Get
|
|
Set
|
|
Me._clearenceType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property previousDocType() As String
|
|
Get
|
|
Return Me._previousDocType
|
|
End Get
|
|
Set
|
|
Me._previousDocType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property previousDocNumber() As String
|
|
Get
|
|
Return Me._previousDocNumber
|
|
End Get
|
|
Set
|
|
Me._previousDocNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property customsOfficeOfDestination() As String
|
|
Get
|
|
Return Me._customsOfficeOfDestination
|
|
End Get
|
|
Set
|
|
Me._customsOfficeOfDestination = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property carrierNumber() As String
|
|
Get
|
|
Return Me._carrierNumber
|
|
End Get
|
|
Set
|
|
Me._carrierNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationUser() As String
|
|
Get
|
|
Return Me._creationUser
|
|
End Get
|
|
Set
|
|
Me._creationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationDate() As Date
|
|
Get
|
|
Return Me._creationDate
|
|
End Get
|
|
Set
|
|
Me._creationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationUser() As String
|
|
Get
|
|
Return Me._modificationUser
|
|
End Get
|
|
Set
|
|
Me._modificationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationDate() As Date
|
|
Get
|
|
Return Me._modificationDate
|
|
End Get
|
|
Set
|
|
Me._modificationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property supervisingOffice() As String
|
|
Get
|
|
Return Me._supervisingOffice
|
|
End Get
|
|
Set
|
|
Me._supervisingOffice = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property typeIdentificationOfTransportArrival() As String
|
|
Get
|
|
Return Me._typeIdentificationOfTransportArrival
|
|
End Get
|
|
Set
|
|
Me._typeIdentificationOfTransportArrival = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property portInspectionOrganizationCode() As String
|
|
Get
|
|
Return Me._portInspectionOrganizationCode
|
|
End Get
|
|
Set
|
|
Me._portInspectionOrganizationCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property licensingOrganizationCode() As String
|
|
Get
|
|
Return Me._licensingOrganizationCode
|
|
End Get
|
|
Set
|
|
Me._licensingOrganizationCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property goodsLocation() As String
|
|
Get
|
|
Return Me._goodsLocation
|
|
End Get
|
|
Set
|
|
Me._goodsLocation = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property destinationPort() As String
|
|
Get
|
|
Return Me._destinationPort
|
|
End Get
|
|
Set
|
|
Me._destinationPort = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property entryPort() As String
|
|
Get
|
|
Return Me._entryPort
|
|
End Get
|
|
Set
|
|
Me._entryPort = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property departurePort() As String
|
|
Get
|
|
Return Me._departurePort
|
|
End Get
|
|
Set
|
|
Me._departurePort = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property destinationInspectionOrganizationCode() As String
|
|
Get
|
|
Return Me._destinationInspectionOrganizationCode
|
|
End Get
|
|
Set
|
|
Me._destinationInspectionOrganizationCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property receivingOrganizationCode() As String
|
|
Get
|
|
Return Me._receivingOrganizationCode
|
|
End Get
|
|
Set
|
|
Me._receivingOrganizationCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property arrivalMeansType() As String
|
|
Get
|
|
Return Me._arrivalMeansType
|
|
End Get
|
|
Set
|
|
Me._arrivalMeansType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property arrivalMeansIdNo() As String
|
|
Get
|
|
Return Me._arrivalMeansIdNo
|
|
End Get
|
|
Set
|
|
Me._arrivalMeansIdNo = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalStatisticalCurrency() As String
|
|
Get
|
|
Return Me._additionalStatisticalCurrency
|
|
End Get
|
|
Set
|
|
Me._additionalStatisticalCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionalStatisticalValue() As Decimal
|
|
Get
|
|
Return Me._additionalStatisticalValue
|
|
End Get
|
|
Set
|
|
Me._additionalStatisticalValue = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property broker() As String
|
|
Get
|
|
Return Me._broker
|
|
End Get
|
|
Set
|
|
Me._broker = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property waybillNumber() As String
|
|
Get
|
|
Return Me._waybillNumber
|
|
End Get
|
|
Set
|
|
Me._waybillNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property waybillDate() As Date
|
|
Get
|
|
Return Me._waybillDate
|
|
End Get
|
|
Set
|
|
Me._waybillDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property houseWaybillNumber() As String
|
|
Get
|
|
Return Me._houseWaybillNumber
|
|
End Get
|
|
Set
|
|
Me._houseWaybillNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(DataType:="date")>
|
|
Public Property houseWaybillDate() As Date
|
|
Get
|
|
Return Me._houseWaybillDate
|
|
End Get
|
|
Set
|
|
Me._houseWaybillDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property locGoods() As TMicLocationOfGoods
|
|
Get
|
|
Return Me._locGoods
|
|
End Get
|
|
Set
|
|
Me._locGoods = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property deferredPayment() As String
|
|
Get
|
|
Return Me._deferredPayment
|
|
End Get
|
|
Set
|
|
Me._deferredPayment = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property presentationsCustomsOffice() As String
|
|
Get
|
|
Return Me._presentationsCustomsOffice
|
|
End Get
|
|
Set
|
|
Me._presentationsCustomsOffice = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property paymentType() As String
|
|
Get
|
|
Return Me._paymentType
|
|
End Get
|
|
Set
|
|
Me._paymentType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicShipmentHead))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicShipmentHead object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicShipmentHead object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicShipmentHead 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 TMicShipmentHead, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicShipmentHead)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicShipmentHead) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicShipmentHead
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicShipmentHead)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicShipmentHead
|
|
Return CType(SerializerXml.Deserialize(s), TMicShipmentHead)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicShipmentHead 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicShipmentHead object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicShipmentHead 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 TMicShipmentHead, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicShipmentHead)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicShipmentHead) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicShipmentHead
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
XmlType(AnonymousType:=True, [Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Public Enum TMicShipmentHeadShipmentType
|
|
|
|
E
|
|
|
|
B
|
|
|
|
U
|
|
|
|
X
|
|
|
|
I
|
|
End Enum
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicDeclType
|
|
|
|
#Region "Private fields"
|
|
Private _type1 As String
|
|
|
|
Private _type2 As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property type1() As String
|
|
Get
|
|
Return Me._type1
|
|
End Get
|
|
Set
|
|
Me._type1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property type2() As String
|
|
Get
|
|
Return Me._type2
|
|
End Get
|
|
Set
|
|
Me._type2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDeclType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicDeclType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicDeclType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicDeclType 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 TMicDeclType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDeclType)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicDeclType) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicDeclType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDeclType)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicDeclType
|
|
Return CType(SerializerXml.Deserialize(s), TMicDeclType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicDeclType 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicDeclType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicDeclType 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 TMicDeclType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDeclType)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicDeclType) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicDeclType
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicMot
|
|
|
|
#Region "Private fields"
|
|
Private _motMode As String
|
|
|
|
Private _meansOfTransport As String
|
|
|
|
Private _motCountry As String
|
|
|
|
Private _motVehicle As String
|
|
|
|
Private _motTransferName As String
|
|
|
|
Private _meansOfTransportDescription As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property motMode() As String
|
|
Get
|
|
Return Me._motMode
|
|
End Get
|
|
Set
|
|
Me._motMode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property meansOfTransport() As String
|
|
Get
|
|
Return Me._meansOfTransport
|
|
End Get
|
|
Set
|
|
Me._meansOfTransport = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property motCountry() As String
|
|
Get
|
|
Return Me._motCountry
|
|
End Get
|
|
Set
|
|
Me._motCountry = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property motVehicle() As String
|
|
Get
|
|
Return Me._motVehicle
|
|
End Get
|
|
Set
|
|
Me._motVehicle = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property motTransferName() As String
|
|
Get
|
|
Return Me._motTransferName
|
|
End Get
|
|
Set
|
|
Me._motTransferName = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property meansOfTransportDescription() As String
|
|
Get
|
|
Return Me._meansOfTransportDescription
|
|
End Get
|
|
Set
|
|
Me._meansOfTransportDescription = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicMot))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicMot object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicMot object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicMot 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 TMicMot, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicMot)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicMot) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicMot
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicMot)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicMot
|
|
Return CType(SerializerXml.Deserialize(s), TMicMot)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicMot 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicMot object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicMot 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 TMicMot, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicMot)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicMot) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicMot
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicFreightCosts
|
|
|
|
#Region "Private fields"
|
|
Private _frtAmount As Decimal
|
|
|
|
Private _frtCurrency As String
|
|
|
|
Private _frtInternational As Decimal
|
|
|
|
Private _frtEuNational As Decimal
|
|
|
|
Private _frtInland As Decimal
|
|
|
|
Private _frtProRating As String
|
|
|
|
Private _frtInternationalAbs As Decimal
|
|
|
|
Private _frtIntCurrency As String
|
|
|
|
Private _frtCommunityAbs As Decimal
|
|
|
|
Private _frtCommunityCurrency As String
|
|
|
|
Private _frtNatAbs As Decimal
|
|
|
|
Private _frtNatCurrency As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property frtAmount() As Decimal
|
|
Get
|
|
Return Me._frtAmount
|
|
End Get
|
|
Set
|
|
Me._frtAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property frtCurrency() As String
|
|
Get
|
|
Return Me._frtCurrency
|
|
End Get
|
|
Set
|
|
Me._frtCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property frtInternational() As Decimal
|
|
Get
|
|
Return Me._frtInternational
|
|
End Get
|
|
Set
|
|
Me._frtInternational = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property frtEuNational() As Decimal
|
|
Get
|
|
Return Me._frtEuNational
|
|
End Get
|
|
Set
|
|
Me._frtEuNational = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property frtInland() As Decimal
|
|
Get
|
|
Return Me._frtInland
|
|
End Get
|
|
Set
|
|
Me._frtInland = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property frtProRating() As String
|
|
Get
|
|
Return Me._frtProRating
|
|
End Get
|
|
Set
|
|
Me._frtProRating = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property frtInternationalAbs() As Decimal
|
|
Get
|
|
Return Me._frtInternationalAbs
|
|
End Get
|
|
Set
|
|
Me._frtInternationalAbs = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property frtIntCurrency() As String
|
|
Get
|
|
Return Me._frtIntCurrency
|
|
End Get
|
|
Set
|
|
Me._frtIntCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property frtCommunityAbs() As Decimal
|
|
Get
|
|
Return Me._frtCommunityAbs
|
|
End Get
|
|
Set
|
|
Me._frtCommunityAbs = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property frtCommunityCurrency() As String
|
|
Get
|
|
Return Me._frtCommunityCurrency
|
|
End Get
|
|
Set
|
|
Me._frtCommunityCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property frtNatAbs() As Decimal
|
|
Get
|
|
Return Me._frtNatAbs
|
|
End Get
|
|
Set
|
|
Me._frtNatAbs = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property frtNatCurrency() As String
|
|
Get
|
|
Return Me._frtNatCurrency
|
|
End Get
|
|
Set
|
|
Me._frtNatCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicFreightCosts))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicFreightCosts object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicFreightCosts object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicFreightCosts 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 TMicFreightCosts, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicFreightCosts)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicFreightCosts) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicFreightCosts
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicFreightCosts)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicFreightCosts
|
|
Return CType(SerializerXml.Deserialize(s), TMicFreightCosts)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicFreightCosts 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicFreightCosts object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicFreightCosts 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 TMicFreightCosts, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicFreightCosts)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicFreightCosts) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicFreightCosts
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicInsuranceCosts
|
|
|
|
#Region "Private fields"
|
|
Private _insAmount As Decimal
|
|
|
|
Private _insCurrency As String
|
|
|
|
Private _insProRating As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property insAmount() As Decimal
|
|
Get
|
|
Return Me._insAmount
|
|
End Get
|
|
Set
|
|
Me._insAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property insCurrency() As String
|
|
Get
|
|
Return Me._insCurrency
|
|
End Get
|
|
Set
|
|
Me._insCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property insProRating() As String
|
|
Get
|
|
Return Me._insProRating
|
|
End Get
|
|
Set
|
|
Me._insProRating = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInsuranceCosts))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicInsuranceCosts object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicInsuranceCosts object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicInsuranceCosts 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 TMicInsuranceCosts, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicInsuranceCosts)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicInsuranceCosts) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicInsuranceCosts
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInsuranceCosts)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicInsuranceCosts
|
|
Return CType(SerializerXml.Deserialize(s), TMicInsuranceCosts)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicInsuranceCosts 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicInsuranceCosts object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicInsuranceCosts 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 TMicInsuranceCosts, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicInsuranceCosts)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicInsuranceCosts) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicInsuranceCosts
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicLocationOfGoods
|
|
|
|
#Region "Private fields"
|
|
Private _qual As String
|
|
|
|
Private _authNo As String
|
|
|
|
Private _additionIdentifier As String
|
|
|
|
Private _type As String
|
|
|
|
Private _customsOffice As String
|
|
|
|
Private _country As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property qual() As String
|
|
Get
|
|
Return Me._qual
|
|
End Get
|
|
Set
|
|
Me._qual = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property authNo() As String
|
|
Get
|
|
Return Me._authNo
|
|
End Get
|
|
Set
|
|
Me._authNo = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property additionIdentifier() As String
|
|
Get
|
|
Return Me._additionIdentifier
|
|
End Get
|
|
Set
|
|
Me._additionIdentifier = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property type() As String
|
|
Get
|
|
Return Me._type
|
|
End Get
|
|
Set
|
|
Me._type = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property customsOffice() As String
|
|
Get
|
|
Return Me._customsOffice
|
|
End Get
|
|
Set
|
|
Me._customsOffice = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property country() As String
|
|
Get
|
|
Return Me._country
|
|
End Get
|
|
Set
|
|
Me._country = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicLocationOfGoods))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicLocationOfGoods object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicLocationOfGoods object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicLocationOfGoods 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 TMicLocationOfGoods, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicLocationOfGoods)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicLocationOfGoods) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicLocationOfGoods
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicLocationOfGoods)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicLocationOfGoods
|
|
Return CType(SerializerXml.Deserialize(s), TMicLocationOfGoods)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicLocationOfGoods 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicLocationOfGoods object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicLocationOfGoods 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 TMicLocationOfGoods, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicLocationOfGoods)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicLocationOfGoods) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicLocationOfGoods
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicDeferAccs
|
|
|
|
#Region "Private fields"
|
|
Private _defermentAccount As TMicDeferAcc
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._defermentAccount = New TMicDeferAcc()
|
|
End Sub
|
|
|
|
Public Property DefermentAccount() As TMicDeferAcc
|
|
Get
|
|
Return Me._defermentAccount
|
|
End Get
|
|
Set
|
|
Me._defermentAccount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDeferAccs))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicDeferAccs object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicDeferAccs object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicDeferAccs 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 TMicDeferAccs, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDeferAccs)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicDeferAccs) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicDeferAccs
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDeferAccs)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicDeferAccs
|
|
Return CType(SerializerXml.Deserialize(s), TMicDeferAccs)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicDeferAccs 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicDeferAccs object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicDeferAccs 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 TMicDeferAccs, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDeferAccs)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicDeferAccs) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicDeferAccs
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicDeferAcc
|
|
|
|
#Region "Private fields"
|
|
Private _accountNumber1 As String
|
|
|
|
Private _accountNumber2 As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property accountNumber1() As String
|
|
Get
|
|
Return Me._accountNumber1
|
|
End Get
|
|
Set
|
|
Me._accountNumber1 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property accountNumber2() As String
|
|
Get
|
|
Return Me._accountNumber2
|
|
End Get
|
|
Set
|
|
Me._accountNumber2 = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDeferAcc))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicDeferAcc object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicDeferAcc object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicDeferAcc 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 TMicDeferAcc, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDeferAcc)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicDeferAcc) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicDeferAcc
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDeferAcc)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicDeferAcc
|
|
Return CType(SerializerXml.Deserialize(s), TMicDeferAcc)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicDeferAcc 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicDeferAcc object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicDeferAcc 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 TMicDeferAcc, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicDeferAcc)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicDeferAcc) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicDeferAcc
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicGuarantees
|
|
|
|
#Region "Private fields"
|
|
Private _guarantee As List(Of TMicGuarantee)
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._guarantee = New List(Of TMicGuarantee)()
|
|
End Sub
|
|
|
|
<XmlElement("Guarantee")>
|
|
Public Property Guarantee() As List(Of TMicGuarantee)
|
|
Get
|
|
Return Me._guarantee
|
|
End Get
|
|
Set
|
|
Me._guarantee = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicGuarantees))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicGuarantees object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicGuarantees object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicGuarantees 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 TMicGuarantees, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicGuarantees)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicGuarantees) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicGuarantees
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicGuarantees)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicGuarantees
|
|
Return CType(SerializerXml.Deserialize(s), TMicGuarantees)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicGuarantees 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicGuarantees object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicGuarantees 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 TMicGuarantees, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicGuarantees)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicGuarantees) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicGuarantees
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicGuarantee
|
|
|
|
#Region "Private fields"
|
|
Private _guaranteeNumber As String
|
|
|
|
Private _guaranteeCode As String
|
|
|
|
Private _guaranteeType As String
|
|
|
|
Private _guaranteeAmount As Decimal
|
|
|
|
Private _guaranteeCurrency As String
|
|
|
|
Private _guaranteeReference As String
|
|
|
|
Private _guaranteeCustomsOffice As String
|
|
|
|
Private _localBase As Decimal
|
|
|
|
Private _factoringBase As String
|
|
|
|
Private _customsRate As Decimal
|
|
|
|
Private _guaranteeOwner As String
|
|
|
|
Private _creationUser As String
|
|
|
|
Private _creationDate As Date
|
|
|
|
Private _modificationUser As String
|
|
|
|
Private _modificationDate As Date
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property guaranteeNumber() As String
|
|
Get
|
|
Return Me._guaranteeNumber
|
|
End Get
|
|
Set
|
|
Me._guaranteeNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property guaranteeCode() As String
|
|
Get
|
|
Return Me._guaranteeCode
|
|
End Get
|
|
Set
|
|
Me._guaranteeCode = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property guaranteeType() As String
|
|
Get
|
|
Return Me._guaranteeType
|
|
End Get
|
|
Set
|
|
Me._guaranteeType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property guaranteeAmount() As Decimal
|
|
Get
|
|
Return Me._guaranteeAmount
|
|
End Get
|
|
Set
|
|
Me._guaranteeAmount = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property guaranteeCurrency() As String
|
|
Get
|
|
Return Me._guaranteeCurrency
|
|
End Get
|
|
Set
|
|
Me._guaranteeCurrency = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property guaranteeReference() As String
|
|
Get
|
|
Return Me._guaranteeReference
|
|
End Get
|
|
Set
|
|
Me._guaranteeReference = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property guaranteeCustomsOffice() As String
|
|
Get
|
|
Return Me._guaranteeCustomsOffice
|
|
End Get
|
|
Set
|
|
Me._guaranteeCustomsOffice = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property localBase() As Decimal
|
|
Get
|
|
Return Me._localBase
|
|
End Get
|
|
Set
|
|
Me._localBase = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property factoringBase() As String
|
|
Get
|
|
Return Me._factoringBase
|
|
End Get
|
|
Set
|
|
Me._factoringBase = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property customsRate() As Decimal
|
|
Get
|
|
Return Me._customsRate
|
|
End Get
|
|
Set
|
|
Me._customsRate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property guaranteeOwner() As String
|
|
Get
|
|
Return Me._guaranteeOwner
|
|
End Get
|
|
Set
|
|
Me._guaranteeOwner = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationUser() As String
|
|
Get
|
|
Return Me._creationUser
|
|
End Get
|
|
Set
|
|
Me._creationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property creationDate() As Date
|
|
Get
|
|
Return Me._creationDate
|
|
End Get
|
|
Set
|
|
Me._creationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationUser() As String
|
|
Get
|
|
Return Me._modificationUser
|
|
End Get
|
|
Set
|
|
Me._modificationUser = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property modificationDate() As Date
|
|
Get
|
|
Return Me._modificationDate
|
|
End Get
|
|
Set
|
|
Me._modificationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicGuarantee))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicGuarantee object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicGuarantee object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicGuarantee 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 TMicGuarantee, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicGuarantee)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicGuarantee) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicGuarantee
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicGuarantee)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicGuarantee
|
|
Return CType(SerializerXml.Deserialize(s), TMicGuarantee)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicGuarantee 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicGuarantee object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicGuarantee 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 TMicGuarantee, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicGuarantee)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicGuarantee) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicGuarantee
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9340.0"),
|
|
System.Serializable,
|
|
DebuggerStepThrough,
|
|
DesignerCategoryAttribute("code"),
|
|
XmlType([Namespace]:="http://www.mic-cust.com/Webservice/MicCustImportMessage/v1.0")>
|
|
Partial Public Class TMicCancellation
|
|
|
|
#Region "Private fields"
|
|
Private _mrn As String
|
|
|
|
Private _generatedLocalReferenceNumber As String
|
|
|
|
Private _cancelType As String
|
|
|
|
Private _cancelReason As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Property mrn() As String
|
|
Get
|
|
Return Me._mrn
|
|
End Get
|
|
Set
|
|
Me._mrn = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property generatedLocalReferenceNumber() As String
|
|
Get
|
|
Return Me._generatedLocalReferenceNumber
|
|
End Get
|
|
Set
|
|
Me._generatedLocalReferenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property cancelType() As String
|
|
Get
|
|
Return Me._cancelType
|
|
End Get
|
|
Set
|
|
Me._cancelType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property cancelReason() As String
|
|
Get
|
|
Return Me._cancelReason
|
|
End Get
|
|
Set
|
|
Me._cancelReason = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicCancellation))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TMicCancellation object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As StreamReader = Nothing
|
|
Dim memoryStream As MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
SerializerXml.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
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 TMicCancellation object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TMicCancellation 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 TMicCancellation, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicCancellation)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicCancellation) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As TMicCancellation
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicCancellation)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As Stream) As TMicCancellation
|
|
Return CType(SerializerXml.Deserialize(s), TMicCancellation)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TMicCancellation 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 StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize()
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
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 TMicCancellation object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TMicCancellation 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 TMicCancellation, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TMicCancellation)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicCancellation) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMicCancellation
|
|
Dim file As FileStream = Nothing
|
|
Dim sr As StreamReader = Nothing
|
|
Try
|
|
file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New StreamReader(file)
|
|
Dim dataString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(dataString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
End Namespace
|
|
#Enable Warning
|