Created
November 10, 2009 15:49
-
-
Save ferventcoder/230970 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Function GetSwapNumber(ByVal session As ISession, ByVal instrument As Instrument) As String | |
Dim swapNumber As String = String.Empty | |
Dim crit As DetachedCriteria = DeCrit.UniqueSwapAssignmentByInstrumentId(instrument) | |
Dim swapAssignments As IList(Of SwapAssignment) | |
Dim newSession As ISession = session.GetSession(EntityMode.Poco) | |
swapAssignments = crit.GetExecutableCriteria(newSession).List(Of SwapAssignment)() | |
For Each swap As SwapAssignment In swapAssignments | |
If (swap.Swap IsNot Nothing) Then | |
If (Not String.IsNullOrEmpty(swapNumber)) Then | |
swapNumber = ";" | |
End If | |
swapNumber += swap.Swap.SwapNumber | |
End If | |
Next | |
Return swapNumber | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment