Demo Final
This commit is contained in:
53
prjOnRampAPI/modOHCommon.vb
Normal file
53
prjOnRampAPI/modOHCommon.vb
Normal file
@@ -0,0 +1,53 @@
|
||||
Imports ORPublicApiRefCore
|
||||
|
||||
Public Module modOHCommon
|
||||
|
||||
|
||||
<ThreadStatic> Private _rstData As List(Of KeyValuePair(Of String, DTRecordSet))
|
||||
Public Property rs(ByVal uniqueIdent As String) As DTRecordSet
|
||||
Get
|
||||
Return rstData(uniqueIdent)
|
||||
End Get
|
||||
Set(value As DTRecordSet)
|
||||
rstData(uniqueIdent) = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property rstData(ByVal uniqueIdent As String) As DTRecordSet
|
||||
Get
|
||||
Dim localRs As List(Of KeyValuePair(Of String, DTRecordSet))
|
||||
|
||||
If _rstData Is Nothing Then
|
||||
_rstData = New List(Of KeyValuePair(Of String, DTRecordSet))
|
||||
End If
|
||||
localRs = _rstData
|
||||
|
||||
For Each kvp As KeyValuePair(Of String, DTRecordSet) In localRs
|
||||
If kvp.Key = uniqueIdent Then
|
||||
Return kvp.Value
|
||||
End If
|
||||
Next kvp
|
||||
'Throw New Exception("rstData(" & uniqueIdent & ") could not be found")
|
||||
Return Nothing
|
||||
End Get
|
||||
Set(ByVal value As DTRecordSet)
|
||||
Dim localRs As List(Of KeyValuePair(Of String, DTRecordSet))
|
||||
|
||||
If _rstData Is Nothing Then
|
||||
_rstData = New List(Of KeyValuePair(Of String, DTRecordSet))
|
||||
End If
|
||||
localRs = _rstData
|
||||
|
||||
'remove from list if exists, then replace
|
||||
For Each kvp As KeyValuePair(Of String, DTRecordSet) In localRs
|
||||
If kvp.Key = uniqueIdent Then
|
||||
localRs.Remove(kvp)
|
||||
Exit For
|
||||
End If
|
||||
Next kvp
|
||||
Dim wrapKVP As New KeyValuePair(Of String, DTRecordSet)(uniqueIdent, value)
|
||||
localRs.Add(wrapKVP)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
End Module
|
||||
Reference in New Issue
Block a user