<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Fondi.aspx.cs" Inherits="OlympiaIntranet.test" %>

<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .height,
        height * {
            height: 34px;
        }
    </style>
    <script type="text/javascript">
        function OnContextMenuItemClick(sender, args) {
            if (args.item.name == "scaricaFondoBBG") {
                args.processOnServer = true;
                args.usePostBack = true;
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <table>
                <tr>
                    <td>
                        <dx:ASPxRadioButtonList ID="rblFiltro" runat="server" RepeatDirection="Horizontal" AutoPostBack="True" OnSelectedIndexChanged="rblFiltro_SelectedIndexChanged" Theme="Aqua" SelectedIndex="1">
                            <Items>
                                <dx:ListEditItem Text="Filtra per Asset Class" Value="0" />
                                <dx:ListEditItem Text="Filtra per Tipo Titolo" Value="1" Selected="True" />
                            </Items>
                        </dx:ASPxRadioButtonList>
                    </td>
                    <td>
                        <dx:ASPxPanel ID="ASPxPanel29" runat="server" Width="10px"></dx:ASPxPanel>
                    </td>
                    <td>
                        <dx:ASPxGridLookup ID="gridlookupCategorie" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDSCategorie" EnableTheming="True" KeyFieldName="Codice" TextFormatString="{0} - {1} - {2}" Theme="Aqua" Width="363px" OnValueChanged="gridlookupCategorie_ValueChanged" CssClass="height" IncrementalFilteringDelay="500" IncrementalFilteringMode="Contains" DropDownStyle="DropDownList">
                            <GridViewProperties>
                                <SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True"></SettingsBehavior>
                                <SettingsPager PageSize="30">
                                </SettingsPager>
                                <EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
                            </GridViewProperties>
                            <Columns>
                                <dx:GridViewDataTextColumn FieldName="Codice" VisibleIndex="0">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="Descrizione" VisibleIndex="1">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="numRecord" VisibleIndex="2" Caption="# Record">
                                </dx:GridViewDataTextColumn>
                            </Columns>
                        </dx:ASPxGridLookup>
                    </td>
                    <td>
                        <dx:ASPxPanel ID="ASPxPanel2" runat="server" Width="10px"></dx:ASPxPanel>
                    </td>
                    <td>
                        <dx:ASPxDateEdit ID="ASPxDateEdit1" runat="server" CssClass="height" Theme="Aqua" DisplayFormatString="dd/MM/yyyy" EditFormat="Custom" EditFormatString="dd/MM/yyyy" Visible="false"></dx:ASPxDateEdit>
                    </td>
                    <td>
                        <dx:ASPxPanel ID="ASPxPanel3" runat="server" Width="10px"></dx:ASPxPanel>
                    </td>
                    <td>
                        <dx:ASPxButton ID="ASPxLoadData" runat="server" CssClass="height" Theme="Aqua" OnClick="ASPxButton1_Click">
                            <Image IconID="arrows_next_32x32">
                            </Image>
                        </dx:ASPxButton>
                    </td>
                </tr>
                <tr>
                    <td>
                        <dx:ASPxPanel ID="ASPxPanel1" runat="server" Width="10px" Height="20px"></dx:ASPxPanel>
                    </td>
                </tr>
                <tr>
                    <dx:ASPxGridView ID="gridviewFondi" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDSFondi" EnableTheming="True" Theme="Aqua" OnContextMenuItemClick="gridviewFondi_ContextMenuItemClick" OnFillContextMenuItems="gridviewFondi_FillContextMenuItems" KeyFieldName="ISIN" >
                        <SettingsAdaptivity>
                            <AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
                        </SettingsAdaptivity>
                        <SettingsContextMenu Enabled="True" EnableRowMenu="True">
                        </SettingsContextMenu>
                        <SettingsPager AlwaysShowPager="True" PageSize="20">
                            <PageSizeItemSettings Visible="True">
                            </PageSizeItemSettings>
                        </SettingsPager>
                        <ClientSideEvents ContextMenuItemClick="function(s,e) { OnContextMenuItemClick(s, e); }" />
                        <Settings ShowFilterRow="True" />
                        <SettingsBehavior AllowFocusedRow="True" EnableRowHotTrack="True" AllowSelectByRowClick="True" />
                        <SettingsDataSecurity AllowDelete="False" AllowEdit="False" AllowInsert="False" />
                        <EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
                        <Columns>
                            <dx:GridViewDataTextColumn FieldName="Security Description" VisibleIndex="0">
                                <PropertiesTextEdit>
                                </PropertiesTextEdit>
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="ISIN" VisibleIndex="1">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="Bloomberg Ticker" VisibleIndex="2">
                                <PropertiesTextEdit>
                                </PropertiesTextEdit>
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataDateColumn FieldName="Inception date" VisibleIndex="4">
                                <PropertiesDateEdit DisplayFormatString="dd/MM/yyyy">
                                </PropertiesDateEdit>
                            </dx:GridViewDataDateColumn>
                            <dx:GridViewDataDateColumn FieldName="Bloomberg Last Update" VisibleIndex="5">
                                <PropertiesDateEdit DisplayFormatString="dd/MM/yyyy">
                                </PropertiesDateEdit>
                            </dx:GridViewDataDateColumn>
                            <dx:GridViewBandColumn Caption="Return 1 Yr" Name="Return 1 Yr" VisibleIndex="8">
                                <HeaderStyle HorizontalAlign="Center" />
                                <Columns>
                                    <dx:GridViewDataTextColumn Caption="Value" FieldName="Return 1 Yr" VisibleIndex="0">
                                        <PropertiesTextEdit DisplayFormatString="0.0000;(0.0000); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="Norm Distr" FieldName="Return 1 Yr (norm distr)" VisibleIndex="1">
                                        <PropertiesTextEdit DisplayFormatString="0.00%;(0.00%); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="Score" FieldName="Return 1 Yr (score)" VisibleIndex="2">
                                        <PropertiesTextEdit DisplayFormatString="0;(0); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                </Columns>
                            </dx:GridViewBandColumn>
                            <dx:GridViewBandColumn Caption="Standard Deviation 3 Yr" Name="Standard Deviation 3 Yr" VisibleIndex="9">
                                <HeaderStyle HorizontalAlign="Center" />
                                <Columns>
                                    <dx:GridViewDataTextColumn Caption="Value" FieldName="Standard Deviation 3 Yr" VisibleIndex="0">
                                        <PropertiesTextEdit DisplayFormatString="0.0000;(0.0000); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="Norm Distr" FieldName="Standard Deviation 3 Yr (norm distr)" VisibleIndex="1">
                                        <PropertiesTextEdit DisplayFormatString="0.00%;(0.00%); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="Score" FieldName="Standard Deviation 3 Yr (score)" VisibleIndex="2">
                                        <PropertiesTextEdit DisplayFormatString="0;(0); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                </Columns>
                            </dx:GridViewBandColumn>
                            <dx:GridViewBandColumn Caption="Management Fees" Name="Management Fees" VisibleIndex="10">
                                <HeaderStyle HorizontalAlign="Center" />
                                <Columns>
                                    <dx:GridViewDataTextColumn Caption="Value" FieldName="Management Fees" VisibleIndex="0">
                                        <PropertiesTextEdit DisplayFormatString="0.0000;(0.0000); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="Norm Distr" FieldName="Management Fees (norm distr)" VisibleIndex="1">
                                        <PropertiesTextEdit DisplayFormatString="0.00%;(0.00%); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="Score" FieldName="Management Fees (score)" VisibleIndex="2">
                                        <PropertiesTextEdit DisplayFormatString="0;(0); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                </Columns>
                            </dx:GridViewBandColumn>
                            <dx:GridViewBandColumn Caption="Total Expense Ratio" Name="Total Expense Ratio" VisibleIndex="11">
                                <HeaderStyle HorizontalAlign="Center" />
                                <Columns>
                                    <dx:GridViewDataTextColumn Caption="Value" FieldName="Total Expense Ratio" VisibleIndex="0">
                                        <PropertiesTextEdit DisplayFormatString="0.0000;(0.0000); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="Norm Distr" FieldName="Total Expense Ratio (norm distr)" VisibleIndex="1">
                                        <PropertiesTextEdit DisplayFormatString="0.00%;(0.00%); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="Score" FieldName="Total Expense Ratio (score)" VisibleIndex="2">
                                        <PropertiesTextEdit DisplayFormatString="0;(0); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                </Columns>
                            </dx:GridViewBandColumn>
                            <dx:GridViewBandColumn Caption="Fund Total Assets (mln)" Name="Fund Total Assets (mln)" VisibleIndex="12">
                                <HeaderStyle HorizontalAlign="Center" />
                                <Columns>
                                    <dx:GridViewDataTextColumn Caption="Value" FieldName="Fund Total Assets (mln)" VisibleIndex="0">
                                        <PropertiesTextEdit DisplayFormatString="0.0000;(0.0000); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="Norm Distr" FieldName="Fund Total Assets (mln) (norm distr)" VisibleIndex="1">
                                        <PropertiesTextEdit DisplayFormatString="0.00%;(0.00%); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="Score" FieldName="Fund Total Assets (mln) (score)" VisibleIndex="2">
                                        <PropertiesTextEdit DisplayFormatString="0;(0); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                </Columns>
                            </dx:GridViewBandColumn>
                            <dx:GridViewBandColumn Caption="Sharpe Ratio 1 Yr" Name="Sharpe Ratio 1 Yr" VisibleIndex="15">
                                <HeaderStyle HorizontalAlign="Center" />
                                <Columns>
                                    <dx:GridViewDataTextColumn Caption="Value" FieldName="Sharpe Ratio 1 Yr" VisibleIndex="0">
                                        <PropertiesTextEdit DisplayFormatString="0.0000;(0.0000); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="Norm Distr" FieldName="Sharpe Ratio 1 Yr (norm distr)" VisibleIndex="1">
                                        <PropertiesTextEdit DisplayFormatString="0.00%;(0.00%); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="Score" FieldName="Sharpe Ratio 1 Yr (score)" VisibleIndex="2">
                                        <PropertiesTextEdit DisplayFormatString="0;(0); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                </Columns>
                            </dx:GridViewBandColumn>
                            <dx:GridViewBandColumn Caption="Downside Risk" Name="Downside Risk" VisibleIndex="21">
                                <HeaderStyle HorizontalAlign="Center" />
                                <Columns>
                                    <dx:GridViewDataTextColumn Caption="Value" FieldName="Downside Risk" VisibleIndex="0">
                                        <PropertiesTextEdit DisplayFormatString="0.0000;(0.0000); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="Norm Distr" FieldName="Downside Risk (norm distr)" VisibleIndex="1">
                                        <PropertiesTextEdit DisplayFormatString="0.00%;(0.00%); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="Score" FieldName="Downside Risk (score)" VisibleIndex="2">
                                        <PropertiesTextEdit DisplayFormatString="0;(0); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                </Columns>
                            </dx:GridViewBandColumn>
                            <dx:GridViewBandColumn Caption="Overall Score" Name="Overall Score" VisibleIndex="6">
                                <HeaderStyle HorizontalAlign="Center" />
                                <Columns>
                                    <dx:GridViewDataTextColumn Caption="Value" FieldName="Overall Score" VisibleIndex="0">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="Norm Distr" FieldName="Overall Score (norm distr)" ReadOnly="True" VisibleIndex="1">
                                        <PropertiesTextEdit DisplayFormatString="0.00%;(0.00%); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                </Columns>
                            </dx:GridViewBandColumn>
                            <dx:GridViewBandColumn Caption="Var 95" Name="Var 95" VisibleIndex="7">
                                <HeaderStyle HorizontalAlign="Center" />
                                <Columns>
                                    <dx:GridViewDataTextColumn Caption="Value" FieldName="Var 95" VisibleIndex="0">
                                        <PropertiesTextEdit DisplayFormatString="0.0000;(0.0000); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="Norm Distr" FieldName="Var 95 (norm distr)" VisibleIndex="1">
                                        <PropertiesTextEdit DisplayFormatString="0.00%;(0.00%); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="Score" FieldName="Var 95 (score)" VisibleIndex="2">
                                        <PropertiesTextEdit DisplayFormatString="0;(0); ">
                                        </PropertiesTextEdit>
                                    </dx:GridViewDataTextColumn>
                                </Columns>
                            </dx:GridViewBandColumn>
                            <dx:GridViewDataTextColumn FieldName="Divisa" VisibleIndex="3">
                            </dx:GridViewDataTextColumn>
                        </Columns>
                    </dx:ASPxGridView>
                </tr>
            </table>
        </div>
        <asp:SqlDataSource ID="SqlDSCategorie" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_CategorieFondi2" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:SessionParameter DbType="Int16" DefaultValue="-1" Name="Switch" SessionField="Switch" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDSFondi" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_ElencoFondi6" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:SessionParameter Name="Switch" SessionField="Switch" />
                <asp:SessionParameter Name="Codice" SessionField="Codice" />
            </SelectParameters>
        </asp:SqlDataSource>
    </form>
</body>
</html>
