18371 lines
635 KiB
VB.net
18371 lines
635 KiB
VB.net
'' ------------------------------------------------------------------------------
|
|
'' <auto-generated>
|
|
'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com
|
|
'' {"TargetFramework":"Net48","NameSpace":"MicCustImportInvoiceComponent","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{},"JsonOutput":{},"Enabled":true},"Miscellaneous":{}}
|
|
'' </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 MicCustImportInvoiceComponent
|
|
|
|
<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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return true
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return false
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As StreamWriter = Nothing
|
|
Try
|
|
Dim dataString As String = Serialize
|
|
Dim outputFile As FileInfo = New FileInfo(fileName)
|
|
streamWriter = outputFile.CreateText
|
|
streamWriter.WriteLine(dataString)
|
|
streamWriter.Close
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <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
|
|
End Namespace
|
|
#Enable Warning
|