1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| Private Sub NAVHistoToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NAVHistoToolStripMenuItem2.Click
Me.DataGridView1.Visible = True
Dim AMS As New EntitiesPorfolio
Dim d As New DateTime(2011, 12, 31, 0, 0, 0)
'*************************
Dim AMS_TABLES As New MF_TABLES()
Dim tblAdapter_NAV_ARC_MULTI_CLASS As New MF_TABLESTableAdapters.NAV_ARC_MULTI_CLASSTableAdapter()
' Füllen des TableAdapters mit Date
tblAdapter_NAV_ARC_MULTI_CLASS.Fill(AMS_TABLES.NAV_ARC_MULTI_CLASS)
Dim nav_DataTable As DataTable = AMS_TABLES.Tables("NAV_ARC_MULTI_CLASS")
Dim AMS_NAV_ARC_MULTI_CLASS_QRY = From nav_arc_multi_class In nav_DataTable
Dim qry_tna = From AMS_NAV_ARC_MULTI_CLASS In AMS_NAV_ARC_MULTI_CLASS_QRY.AsEnumerable()
Join AMS_PORFOLIO In AMS.PORFOLIO On AMS_NAV_ARC_MULTI_CLASS.Field(Of String)("NPTF") Equals AMS_PORFOLIO.NPTF
Join AMS_PART_PTF In AMS.PART_PTF On AMS_NAV_ARC_MULTI_CLASS.Field(Of String)("NPTF") Equals AMS_PART_PTF.NPTF And AMS_NAV_ARC_MULTI_CLASS.Field(Of String)("TPARTS") Equals AMS_PART_PTF.TPARTS
Join AMS_VALEURS In AMS.VALEURS On AMS_PART_PTF.NOVAL Equals AMS_VALEURS.NOVAL
Group Join AMS_NAV_ARC_MON_PRICE In AMS.NAV_ARC_MON_PRICE On AMS_NAV_ARC_MULTI_CLASS.Field(Of String)("NPTF") Equals AMS_NAV_ARC_MON_PRICE.NPTF And AMS_NAV_ARC_MULTI_CLASS.Field(Of Date)("DATE_NAV") Equals AMS_NAV_ARC_MON_PRICE.DATE_NAV And AMS_NAV_ARC_MULTI_CLASS.Field(Of String)("TPARTS") Equals AMS_NAV_ARC_MON_PRICE.TPARTS Into boubouliste = Group
From GRP_NAV_ARC_MON_PRICE In boubouliste.DefaultIfEmpty()
Where (AMS_PORFOLIO.NPTF = "178820" And AMS_NAV_ARC_MULTI_CLASS.Field(Of Decimal)("OUTSTANDING_SHARES") <> 0)
Order By AMS_NAV_ARC_MULTI_CLASS.Field(Of Date)("DATE_NAV") Descending
Select New With {
.FUND = AMS_PORFOLIO.NPTF,
.CCY_FUND = AMS_PORFOLIO.CMONREF,
.CLASS = AMS_VALEURS.NOMVAL,
.TYPE = AMS_NAV_ARC_MULTI_CLASS.Field(Of String)("TYP_TRT"),
.TPARTS = AMS_NAV_ARC_MULTI_CLASS.Field(Of String)("TPARTS"),
.DATE_NAV = AMS_NAV_ARC_MULTI_CLASS.Field(Of Date)("DATE_NAV"),
.SHARES = AMS_NAV_ARC_MULTI_CLASS.Field(Of Decimal)("OUTSTANDING_SHARES"),
'cette ligne pose PB -> .CCY_RATE = If(AMS_NAV_ARC_MULTI_CLASS.Field(Of String)("TPARTS") = GRP_NAV_ARC_MON_PRICE.TPARTS, GRP_NAV_ARC_MON_PRICE.TCHG, "1"),
.SHARES_UNIT_F = AMS_NAV_ARC_MULTI_CLASS.Field(Of Decimal)("PRICE_PART"),
.CCY2 = AMS_PORFOLIO.CMONREF,
.TNA_F = AMS_NAV_ARC_MULTI_CLASS.Field(Of Decimal)("NAV_AFTER_DISTRIB"),
.CCY3 = AMS_PORFOLIO.CMONREF
} Distinct
DataGridView1.DataSource = qry_tna.ToList
End Sub |
Partager