Skip to content

Instantly share code, notes, and snippets.

@ferventcoder
Created November 10, 2009 15:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ferventcoder/230970 to your computer and use it in GitHub Desktop.
Save ferventcoder/230970 to your computer and use it in GitHub Desktop.
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