ferventcoder (owner)

Revisions

gist: 230970 Download_button fork
public
Public Clone URL: git://gist.github.com/230970.git
Embed All Files: show embed
GetSwap.VB #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
        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