MS Modules windream integriert
This commit is contained in:
parent
ceb618dc57
commit
5774eb7686
@ -40,6 +40,7 @@
|
||||
Public Const HISTORY_NEW_FROM_VERSION = "HISTORY_New_From_Version"
|
||||
Public Const HISTORY_USER_DEFINED = "HISTORY_User_Defined"
|
||||
|
||||
|
||||
' Entity Types
|
||||
Public Const ENTITY_TYPE_OBJECTTYPE = 10
|
||||
|
||||
@ -54,6 +55,7 @@
|
||||
|
||||
' Misc
|
||||
Public Const OBJECT_TYPE_DEFAULT = "Standard"
|
||||
Public Const DELETE_ATTRIBUTE_VALUE = "DeleteWMAttributeValue"
|
||||
|
||||
' File Stream
|
||||
Public Const STREAM_BINARY_OBJECT = "BinaryObject"
|
||||
|
||||
@ -20,51 +20,84 @@ Public Class Helpers
|
||||
ReDim myArray(0)
|
||||
Select Case pIndexType
|
||||
Case INDEX_TYPE_HASH ' 36865
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return String.Empty
|
||||
Else
|
||||
'Umwandeln in String
|
||||
myArray(0) = CStr(pValue)
|
||||
Return myArray
|
||||
End If
|
||||
Case INDEX_TYPE_VECTOR_STRING '4097
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return String.Empty
|
||||
Else
|
||||
'Umwandeln in String
|
||||
myArray(0) = CStr(pValue)
|
||||
Return myArray(0)
|
||||
End If
|
||||
Case INDEX_TYPE_VECTOR_INTEGER '4098
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
'Umwandeln in Integer
|
||||
myArray(0) = CInt(pValue.Replace(" ", ""))
|
||||
Return myArray
|
||||
End If
|
||||
Case INDEX_TYPE_VECTOR_FLOAT '4099
|
||||
pValue = pValue.
|
||||
Replace(" ", "").
|
||||
Replace(".", ",")
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
'Umwandeln in Double
|
||||
myArray(0) = CDbl(pValue)
|
||||
Return myArray
|
||||
End If
|
||||
Case INDEX_TYPE_VECTOR_BOOLEAN '4100
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
'Umwandeln in Boolean
|
||||
myArray(0) = CBool(pValue)
|
||||
Return myArray
|
||||
End If
|
||||
|
||||
Case INDEX_TYPE_VECTOR_DATE '4101
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
'Umwandeln in Date
|
||||
myArray(0) = CDate(pValue)
|
||||
Return myArray
|
||||
End If
|
||||
Case INDEX_TYPE_VECTOR_INTEGER_64BIT '4107
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
'Umwandeln in Date
|
||||
myArray(0) = Convert.ToInt64(pValue)
|
||||
Return myArray
|
||||
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
|
||||
pValue = pValue.Replace(" ", "")
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
'Umwandeln in Integer
|
||||
myArray(0) = CInt(pValue.Replace(" ", ""))
|
||||
Return myArray
|
||||
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
|
||||
' 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
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return String.Empty
|
||||
Else
|
||||
Return pValue
|
||||
End If
|
||||
Case INDEX_TYPE_INTEGER
|
||||
pValue = pValue.Replace(" ", String.Empty)
|
||||
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)
|
||||
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)
|
||||
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
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return Convert.ToBoolean(pValue)
|
||||
End If
|
||||
|
||||
Case INDEX_TYPE_DATE
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return Convert.ToDateTime(pValue)
|
||||
End If
|
||||
|
||||
Case INDEX_TYPE_DATE_TIME
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return Convert.ToDateTime(pValue)
|
||||
End If
|
||||
Case INDEX_TYPE_TIME
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return Convert.ToDateTime(pValue)
|
||||
End If
|
||||
Case INDEX_TYPE_VECTOR_DATE_TIME
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return Convert.ToDateTime(pValue)
|
||||
End If
|
||||
Case INDEX_TYPE_VECTOR_DATE
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return Convert.ToDateTime(pValue)
|
||||
End If
|
||||
Case INDEX_TYPE_FLOAT
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return Convert.ToDouble(pValue)
|
||||
End If
|
||||
|
||||
Case INDEX_TYPE_VECTOR_FLOAT
|
||||
If pValue = DELETE_ATTRIBUTE_VALUE Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return Convert.ToDouble(pValue)
|
||||
End If
|
||||
Case INDEX_TYPE_CURRENCY
|
||||
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
|
||||
|
||||
@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.9.6.2")>
|
||||
<Assembly: AssemblyFileVersion("1.9.6.2")>
|
||||
<Assembly: AssemblyVersion("1.9.7.0")>
|
||||
<Assembly: AssemblyFileVersion("1.9.7.0")>
|
||||
|
||||
@ -1220,7 +1220,7 @@ Public Class Windream
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function SetFileIndex(Path As String, IndexName As String, Value As String, ObjectType As String) As Boolean
|
||||
Public Function SetFileIndex(Path As String, pIndexName As String, pStringValue As String, pObjectType As String) As Boolean
|
||||
If TestSessionLoggedIn() = False Then
|
||||
Return False
|
||||
End If
|
||||
@ -1238,15 +1238,15 @@ Public Class Windream
|
||||
End If
|
||||
|
||||
If oWMObject.aObjectType.aName = Constants.OBJECT_TYPE_DEFAULT Then
|
||||
oWMObject.aObjectType = GetObjectByName(ObjectType, WMEntityObjectType)
|
||||
oWMObject.aObjectType = GetObjectByName(pObjectType, WMEntityObjectType)
|
||||
End If
|
||||
|
||||
Try
|
||||
Dim oType As Integer = GetIndexType(IndexName)
|
||||
Dim oType As Integer = GetIndexType(pIndexName)
|
||||
If Not IsNothing(oType) Then
|
||||
Dim oConvertedValue As Object = Helpers.ConvertIndexValue(oType, Value)
|
||||
Dim oConvertedValue As Object = Helpers.ConvertIndexValue(oType, pStringValue)
|
||||
|
||||
oWMObject.SetVariableValue(IndexName, oConvertedValue)
|
||||
oWMObject.SetVariableValue(pIndexName, oConvertedValue)
|
||||
oWMObject.Save()
|
||||
|
||||
If UnlockObject(oWMObject) = False Then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user