MS Helpers
This commit is contained in:
parent
d4ce8e2891
commit
a6d3781781
@ -121,6 +121,8 @@ Public Class PropertyValues
|
||||
_logger.Debug("Processing itemSpecification *TableColumn* [{0}].", oTableColumn)
|
||||
If oTableColumn = "INVOICE_SELLER_EMAIL" Then
|
||||
Console.WriteLine("INVOICE_SELLER_EMAIL")
|
||||
ElseIf oTableColumn = "INVOICE_POSITION_ARTICLE" Then
|
||||
Console.WriteLine("INVOICE_POSITION_ARTICLE")
|
||||
End If
|
||||
If IsNothing(oPropertyValue) OrElse String.IsNullOrEmpty(oPropertyValue) Then
|
||||
If oColumn.Key.IsRequired Then
|
||||
|
||||
@ -16,7 +16,7 @@ Public Class Helpers
|
||||
}
|
||||
|
||||
Friend Shared Function ConvertVectorType(pIndexType As Integer, pValue As String)
|
||||
Dim myArray
|
||||
Dim myArray()
|
||||
ReDim myArray(0)
|
||||
Select Case pIndexType
|
||||
Case INDEX_TYPE_HASH ' 36865
|
||||
@ -26,11 +26,7 @@ Public Class Helpers
|
||||
Case INDEX_TYPE_VECTOR_STRING '4097
|
||||
'Umwandeln in String
|
||||
myArray(0) = CStr(pValue)
|
||||
Return myArray
|
||||
Case 8204 'auch INDEX_TYPE_VECTOR_STRING
|
||||
'Umwandeln in String
|
||||
myArray(0) = CStr(pValue)
|
||||
Return myArray
|
||||
Return myArray(0)
|
||||
Case INDEX_TYPE_VECTOR_INTEGER '4098
|
||||
'Umwandeln in Integer
|
||||
myArray(0) = CInt(pValue.Replace(" ", ""))
|
||||
@ -69,10 +65,11 @@ Public Class Helpers
|
||||
|
||||
Friend Shared Function ConvertIndexValue(Type As Integer, pValue As String) As Object
|
||||
' Leerzeichen an Anfang und Ende entfernen
|
||||
pValue = pValue.Trim()
|
||||
If Type > 4095 Then
|
||||
Return ConvertVectorType(Type, pValue)
|
||||
End If
|
||||
pValue = pValue.Trim()
|
||||
|
||||
|
||||
Select Case Type
|
||||
Case INDEX_TYPE_HASH
|
||||
@ -117,6 +114,92 @@ Public Class Helpers
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Friend Shared Function ConvertAttrValue(Type As Integer, pValue As String) As Object
|
||||
' Leerzeichen an Anfang und Ende entfernen
|
||||
pValue = pValue.Trim()
|
||||
If Type > 4095 Then
|
||||
Return ConvertVectorType1(Type, pValue)
|
||||
End If
|
||||
|
||||
|
||||
Select Case Type
|
||||
Case INDEX_TYPE_HASH
|
||||
Return pValue
|
||||
Case INDEX_TYPE_STRING
|
||||
Return pValue
|
||||
Case INDEX_TYPE_VECTOR_STRING
|
||||
Return pValue
|
||||
Case INDEX_TYPE_INTEGER
|
||||
pValue = pValue.Replace(" ", String.Empty)
|
||||
Return Convert.ToInt32(pValue)
|
||||
Case INDEX_TYPE_VECTOR_INTEGER
|
||||
pValue = pValue.Replace(" ", String.Empty)
|
||||
Return Convert.ToInt32(pValue)
|
||||
Case INDEX_TYPE_VECTOR_INTEGER_64BIT
|
||||
pValue = pValue.Replace(" ", String.Empty)
|
||||
Return Convert.ToInt64(pValue)
|
||||
Case INDEX_TYPE_VECTOR_BOOLEAN
|
||||
Return Convert.ToBoolean(pValue)
|
||||
Case INDEX_TYPE_BOOLEAN
|
||||
Return Convert.ToBoolean(pValue)
|
||||
Case INDEX_TYPE_DATE
|
||||
Return Convert.ToDateTime(pValue)
|
||||
Case INDEX_TYPE_DATE_TIME
|
||||
Return Convert.ToDateTime(pValue)
|
||||
Case INDEX_TYPE_TIME
|
||||
Return Convert.ToDateTime(pValue)
|
||||
Case INDEX_TYPE_VECTOR_DATE_TIME
|
||||
Return Convert.ToDateTime(pValue)
|
||||
Case INDEX_TYPE_VECTOR_DATE
|
||||
Return Convert.ToDateTime(pValue)
|
||||
Case INDEX_TYPE_FLOAT
|
||||
Return Convert.ToDouble(pValue)
|
||||
Case INDEX_TYPE_VECTOR_FLOAT
|
||||
Return Convert.ToDouble(pValue)
|
||||
Case INDEX_TYPE_CURRENCY
|
||||
'Wegen currency muß ein eigenes Objekt vom typ Variant erzeugt werden
|
||||
Dim aValueWrapper As System.Runtime.InteropServices.CurrencyWrapper = New System.Runtime.InteropServices.CurrencyWrapper(CDec(pValue))
|
||||
Return aValueWrapper
|
||||
Case Else
|
||||
Return pValue
|
||||
End Select
|
||||
End Function
|
||||
Friend Shared Function ConvertVectorType1(pIndexType As Integer, pValue As String)
|
||||
Select Case pIndexType
|
||||
Case INDEX_TYPE_HASH ' 36865
|
||||
'Umwandeln in String
|
||||
Return CStr(pValue)
|
||||
Case INDEX_TYPE_VECTOR_STRING '4097
|
||||
'Umwandeln in String
|
||||
Return CStr(pValue)
|
||||
Case INDEX_TYPE_VECTOR_INTEGER '4098
|
||||
'Umwandeln in Integer
|
||||
Return CInt(pValue.Replace(" ", ""))
|
||||
Case INDEX_TYPE_VECTOR_FLOAT '4099
|
||||
pValue = pValue.
|
||||
Replace(" ", "").
|
||||
Replace(".", ",")
|
||||
'Umwandeln in Double
|
||||
Return CDbl(pValue)
|
||||
Case INDEX_TYPE_VECTOR_BOOLEAN '4100
|
||||
'Umwandeln in Boolean
|
||||
Return CBool(pValue)
|
||||
Case INDEX_TYPE_VECTOR_DATE '4101
|
||||
'Umwandeln in Date
|
||||
Return CDate(pValue)
|
||||
Case INDEX_TYPE_VECTOR_INTEGER_64BIT '4107
|
||||
Return Convert.ToInt64(pValue)
|
||||
Case INDEX_TYPE_VECTOR_DATE_TIME '4103
|
||||
'Umwandeln in Datum Uhrzeit
|
||||
Return pValue
|
||||
Case 8204
|
||||
'Umwandeln in Integer
|
||||
Return CInt(pValue.Replace(" ", ""))
|
||||
Case Else
|
||||
'Umwandeln in String
|
||||
Return CStr(pValue)
|
||||
End Select
|
||||
End Function
|
||||
Friend Shared Function IsVectorIndex(indexType As Integer)
|
||||
Return VectorIndicies.Contains(indexType)
|
||||
End Function
|
||||
|
||||
@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.9.5.2")>
|
||||
<Assembly: AssemblyFileVersion("1.9.5.2")>
|
||||
<Assembly: AssemblyVersion("1.9.6.0")>
|
||||
<Assembly: AssemblyFileVersion("1.9.6.0")>
|
||||
|
||||
@ -1304,7 +1304,7 @@ Public Class Windream
|
||||
ReDim oArray(Values.Count - 1)
|
||||
|
||||
For oIndex = 0 To Values.Count - 1
|
||||
Dim oValue As Object = Helpers.ConvertIndexValue(oType, Values.Item(oIndex))
|
||||
Dim oValue As Object = Helpers.ConvertAttrValue(oType, Values.Item(oIndex))
|
||||
oArray(oIndex) = oValue
|
||||
Next
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user