MS Modules windream integriert
This commit is contained in:
@@ -20,51 +20,84 @@ Public Class Helpers
|
||||
ReDim myArray(0)
|
||||
Select Case pIndexType
|
||||
Case INDEX_TYPE_HASH ' 36865
|
||||
'Umwandeln in String
|
||||
myArray(0) = CStr(pValue)
|
||||
Return myArray
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return String.Empty
|
||||
Else
|
||||
'Umwandeln in String
|
||||
myArray(0) = CStr(pValue)
|
||||
End If
|
||||
Case INDEX_TYPE_VECTOR_STRING '4097
|
||||
'Umwandeln in String
|
||||
myArray(0) = CStr(pValue)
|
||||
Return myArray(0)
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return String.Empty
|
||||
Else
|
||||
'Umwandeln in String
|
||||
myArray(0) = CStr(pValue)
|
||||
End If
|
||||
Case INDEX_TYPE_VECTOR_INTEGER '4098
|
||||
'Umwandeln in Integer
|
||||
myArray(0) = CInt(pValue.Replace(" ", ""))
|
||||
Return myArray
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
'Umwandeln in Integer
|
||||
myArray(0) = CInt(pValue.Replace(" ", ""))
|
||||
End If
|
||||
Case INDEX_TYPE_VECTOR_FLOAT '4099
|
||||
pValue = pValue.
|
||||
Replace(" ", "").
|
||||
Replace(".", ",")
|
||||
'Umwandeln in Double
|
||||
myArray(0) = CDbl(pValue)
|
||||
Return myArray
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
'Umwandeln in Double
|
||||
myArray(0) = CDbl(pValue)
|
||||
End If
|
||||
Case INDEX_TYPE_VECTOR_BOOLEAN '4100
|
||||
'Umwandeln in Boolean
|
||||
myArray(0) = CBool(pValue)
|
||||
Return myArray
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
'Umwandeln in Boolean
|
||||
myArray(0) = CBool(pValue)
|
||||
End If
|
||||
|
||||
Case INDEX_TYPE_VECTOR_DATE '4101
|
||||
'Umwandeln in Date
|
||||
myArray(0) = CDate(pValue)
|
||||
Return myArray
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
'Umwandeln in Date
|
||||
myArray(0) = CDate(pValue)
|
||||
End If
|
||||
Case INDEX_TYPE_VECTOR_INTEGER_64BIT '4107
|
||||
myArray(0) = Convert.ToInt64(pValue)
|
||||
Return myArray
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
'Umwandeln in Date
|
||||
myArray(0) = Convert.ToInt64(pValue)
|
||||
End If
|
||||
Case INDEX_TYPE_VECTOR_DATE_TIME '4103
|
||||
'Umwandeln in Datum Uhrzeit
|
||||
Return pValue
|
||||
Return Convert.ToDateTime(pValue)
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
'Umwandeln in Date
|
||||
myArray(0) = Convert.ToDateTime(pValue)
|
||||
End If
|
||||
|
||||
Case 8204
|
||||
'Umwandeln in Integer
|
||||
myArray(0) = CInt(pValue.Replace(" ", ""))
|
||||
Return myArray
|
||||
pValue = pValue.Replace(" ", "")
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
'Umwandeln in Integer
|
||||
myArray(0) = CInt(pValue.Replace(" ", ""))
|
||||
End If
|
||||
Case Else
|
||||
'Umwandeln in String
|
||||
myArray(0) = CStr(pValue)
|
||||
Return myArray
|
||||
End Select
|
||||
Return myArray
|
||||
End Function
|
||||
|
||||
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)
|
||||
@@ -75,40 +108,102 @@ Public Class Helpers
|
||||
Case INDEX_TYPE_HASH
|
||||
Return pValue
|
||||
Case INDEX_TYPE_STRING
|
||||
Return pValue
|
||||
' Leerzeichen an Anfang und Ende entfernen
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return String.Empty
|
||||
Else
|
||||
Return pValue
|
||||
End If
|
||||
|
||||
Case INDEX_TYPE_VECTOR_STRING
|
||||
Return pValue
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return String.Empty
|
||||
Else
|
||||
Return pValue
|
||||
End If
|
||||
Case INDEX_TYPE_INTEGER
|
||||
pValue = pValue.Replace(" ", String.Empty)
|
||||
Return Convert.ToInt32(pValue)
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return Convert.ToInt32(pValue)
|
||||
End If
|
||||
Case INDEX_TYPE_VECTOR_INTEGER
|
||||
pValue = pValue.Replace(" ", String.Empty)
|
||||
Return Convert.ToInt32(pValue)
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return Convert.ToInt32(pValue)
|
||||
End If
|
||||
Case INDEX_TYPE_VECTOR_INTEGER_64BIT
|
||||
pValue = pValue.Replace(" ", String.Empty)
|
||||
Return Convert.ToInt64(pValue)
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return Convert.ToInt64(pValue)
|
||||
End If
|
||||
Case INDEX_TYPE_VECTOR_BOOLEAN
|
||||
Return Convert.ToBoolean(pValue)
|
||||
Case INDEX_TYPE_BOOLEAN
|
||||
Return Convert.ToBoolean(pValue)
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return Convert.ToBoolean(pValue)
|
||||
End If
|
||||
|
||||
Case INDEX_TYPE_DATE
|
||||
Return Convert.ToDateTime(pValue)
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return Convert.ToDateTime(pValue)
|
||||
End If
|
||||
|
||||
Case INDEX_TYPE_DATE_TIME
|
||||
Return Convert.ToDateTime(pValue)
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return Convert.ToDateTime(pValue)
|
||||
End If
|
||||
Case INDEX_TYPE_TIME
|
||||
Return Convert.ToDateTime(pValue)
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return Convert.ToDateTime(pValue)
|
||||
End If
|
||||
Case INDEX_TYPE_VECTOR_DATE_TIME
|
||||
Return Convert.ToDateTime(pValue)
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return Convert.ToDateTime(pValue)
|
||||
End If
|
||||
Case INDEX_TYPE_VECTOR_DATE
|
||||
Return Convert.ToDateTime(pValue)
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return Convert.ToDateTime(pValue)
|
||||
End If
|
||||
Case INDEX_TYPE_FLOAT
|
||||
Return Convert.ToDouble(pValue)
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return Convert.ToDouble(pValue)
|
||||
End If
|
||||
|
||||
Case INDEX_TYPE_VECTOR_FLOAT
|
||||
Return Convert.ToDouble(pValue)
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return Convert.ToDouble(pValue)
|
||||
End If
|
||||
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
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
'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
|
||||
End If
|
||||
|
||||
Case Else
|
||||
Return pValue
|
||||
End Select
|
||||
|
||||
Reference in New Issue
Block a user