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

<%@ 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>
        /* Rimuove gli stili del tema dal header */
        .dxgvHeader_Office2010Blue {
            background: transparent !important;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <dx:ASPxGridView ID="gvRetrocessioni" runat="server" EnableTheming="True" Theme="MetropolisBlue" DataSourceID="SqlDSGDNRetrocessioni" AutoGenerateColumns="False" KeyFieldName="IDGDNRetrocessioni">
                <SettingsPager AlwaysShowPager="True" PageSize="20">
                    <PageSizeItemSettings ShowAllItem="True" Visible="True">
                    </PageSizeItemSettings>
                </SettingsPager>
                <Settings ShowFilterRow="True" ShowHeaderFilterButton="True" ShowFilterBar="Visible" />

                <SettingsPopup>
                    <FilterControl AutoUpdatePosition="False"></FilterControl>
                </SettingsPopup>

                <SettingsFilterControl ViewMode="VisualAndText">
                </SettingsFilterControl>
                <EditFormLayoutProperties ColCount="4" ColumnCount="4">
                    <Items>
                        <dx:GridViewColumnLayoutItem ColSpan="1" ColumnName="Gruppo">
                        </dx:GridViewColumnLayoutItem>
                        <dx:GridViewLayoutGroup Caption="Sez. Gestori" ColSpan="1" Name="Gestori">
                            <Items>
                                <dx:GridViewColumnLayoutItem Caption="Gestori" ColSpan="1" ColumnName="Gestore">
                                </dx:GridViewColumnLayoutItem>
                                <dx:GridViewColumnLayoutItem ColSpan="1" ColumnName="CommissioneGes">
                                </dx:GridViewColumnLayoutItem>
                            </Items>
                        </dx:GridViewLayoutGroup>
                        <dx:GridViewLayoutGroup Caption="Sez. Advisors" ColSpan="1" Name="Advisors">
                            <Items>
                                <dx:GridViewColumnLayoutItem Caption="Advisor" ColSpan="1" ColumnName="Advisor">
                                </dx:GridViewColumnLayoutItem>
                                <dx:GridViewColumnLayoutItem ColSpan="1" ColumnName="CommissioneAdv">
                                </dx:GridViewColumnLayoutItem>
                            </Items>
                        </dx:GridViewLayoutGroup>
                        <dx:GridViewLayoutGroup Caption="Sez. Consulenti" ColSpan="1" Name="Consulenti">
                            <Items>
                                <dx:GridViewColumnLayoutItem Caption="Consulenti" ColSpan="1" ColumnName="Consulente">
                                </dx:GridViewColumnLayoutItem>
                                <dx:GridViewColumnLayoutItem ColSpan="1" ColumnName="CommissioneCon">
                                </dx:GridViewColumnLayoutItem>
                            </Items>
                        </dx:GridViewLayoutGroup>
                        <dx:EditModeCommandLayoutItem ColSpan="2" ColumnSpan="2" HorizontalAlign="Left">
                        </dx:EditModeCommandLayoutItem>
                    </Items>
                </EditFormLayoutProperties>
                <Columns>
                    <dx:GridViewCommandColumn ShowDeleteButton="True" ShowEditButton="True" ShowNewButtonInHeader="True" VisibleIndex="0">
                    </dx:GridViewCommandColumn>
                    <dx:GridViewDataTextColumn FieldName="IDGDNRetrocessioni" ReadOnly="True" Visible="False" VisibleIndex="1">
                        <EditFormSettings Visible="False" />
                    </dx:GridViewDataTextColumn>
                    <dx:GridViewDataTextColumn FieldName="Gruppo" VisibleIndex="2">
                    </dx:GridViewDataTextColumn>
                    <dx:GridViewBandColumn Caption="GESTORE" Name="GESTORE" VisibleIndex="3">
                        <HeaderStyle BackColor="#33CC33" HorizontalAlign="Center" />
                        <Columns>
                            <dx:GridViewDataComboBoxColumn Caption="Nome" FieldName="Gestore" ShowInCustomizationForm="True" VisibleIndex="0">
                                <PropertiesComboBox DataSourceID="SqlDSGestori" TextField="Gestore" ValueField="Gestore">
                                </PropertiesComboBox>
                                <HeaderStyle BackColor="#33CC33" />
                            </dx:GridViewDataComboBoxColumn>
                            <dx:GridViewDataTextColumn Caption="Commissione" FieldName="CommissioneGes" ShowInCustomizationForm="True" VisibleIndex="1">
                                <PropertiesTextEdit DisplayFormatString="P2">
                                </PropertiesTextEdit>
                                <HeaderStyle BackColor="#33CC33" />
                            </dx:GridViewDataTextColumn>
                        </Columns>
                    </dx:GridViewBandColumn>
                    <dx:GridViewBandColumn Caption="ADVISOR" Name="ADVISOR" VisibleIndex="4">
                        <HeaderStyle BackColor="#66CCFF" HorizontalAlign="Center" />
                        <Columns>
                            <dx:GridViewDataComboBoxColumn Caption="Nome" FieldName="Advisor" ShowInCustomizationForm="True" VisibleIndex="0">
                                <PropertiesComboBox DataSourceID="SqlDSAdvisors" TextField="Advisor" ValueField="Advisor">
                                </PropertiesComboBox>
                                <HeaderStyle BackColor="#66CCFF" />
                            </dx:GridViewDataComboBoxColumn>
                            <dx:GridViewDataTextColumn Caption="Commissione" FieldName="CommissioneAdv" ShowInCustomizationForm="True" VisibleIndex="1">
                                <PropertiesTextEdit DisplayFormatString="P2">
                                </PropertiesTextEdit>
                                <HeaderStyle BackColor="#66CCFF" />
                            </dx:GridViewDataTextColumn>
                        </Columns>
                    </dx:GridViewBandColumn>
                    <dx:GridViewBandColumn Caption="CONSULENTE" Name="CONSULENTE" VisibleIndex="7">
                        <HeaderStyle BackColor="#FFCC66" HorizontalAlign="Center" />
                        <Columns>
                            <dx:GridViewDataComboBoxColumn Caption="Nome" FieldName="Consulente" ShowInCustomizationForm="True" VisibleIndex="0">
                                <PropertiesComboBox DataSourceID="SqlDSConsulenti" TextField="Consulente" ValueField="Consulente">
                                </PropertiesComboBox>
                                <HeaderStyle BackColor="#FFCC66" />
                            </dx:GridViewDataComboBoxColumn>
                            <dx:GridViewDataTextColumn Caption="Commissione" FieldName="CommissioneCon" ShowInCustomizationForm="True" VisibleIndex="1">
                                <PropertiesTextEdit DisplayFormatString="P2">
                                </PropertiesTextEdit>
                                <HeaderStyle BackColor="#FFCC66" />
                            </dx:GridViewDataTextColumn>
                        </Columns>
                    </dx:GridViewBandColumn>
                </Columns>
            </dx:ASPxGridView>
            <asp:SqlDataSource ID="SqlDSGDNRetrocessioni" runat="server" ConnectionString="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection %>" InsertCommand="GDN_Retrocessioni_Insert" InsertCommandType="StoredProcedure" SelectCommand="GDN_Retrocessioni_Load" SelectCommandType="StoredProcedure" UpdateCommand="GDN_Retrocessioni_Update" UpdateCommandType="StoredProcedure" DeleteCommand="GDN_Retrocessioni_Delete" DeleteCommandType="StoredProcedure">
                <DeleteParameters>
                    <asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
                    <asp:Parameter Name="IDGDNRetrocessioni" Type="Int32" />
                </DeleteParameters>
                <InsertParameters>
                    <asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
                    <asp:Parameter Name="Gruppo" Type="String" />
                    <asp:Parameter Name="Advisor" Type="String" />
                    <asp:Parameter Name="Consulente" Type="String" />
                    <asp:Parameter Name="Gestore" Type="String" />
                    <asp:Parameter Name="CommissioneAdv" Type="Double" />
                    <asp:Parameter Name="CommissioneGes" Type="Double" />
                    <asp:Parameter Name="CommissioneCon" Type="Double" />
                </InsertParameters>
                <UpdateParameters>
                    <asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
                    <asp:Parameter Name="IDGDNRetrocessioni" Type="Int32" />
                    <asp:Parameter Name="Gruppo" Type="String" />
                    <asp:Parameter Name="Advisor" Type="String" />
                    <asp:Parameter Name="Consulente" Type="String" />
                    <asp:Parameter Name="Gestore" Type="String" />
                    <asp:Parameter Name="CommissioneAdv" Type="Double" />
                    <asp:Parameter Name="CommissioneGes" Type="Double" />
                    <asp:Parameter Name="CommissioneCon" Type="Double" />
                </UpdateParameters>
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="SqlDSAdvisors" runat="server" ConnectionString="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection %>" SelectCommand="SELECT NULL AS Advisor UNION SELECT cod_adv AS Advisor  FROM dbo.GDN_itvElencoAdvisor() ORDER BY Advisor"></asp:SqlDataSource>
            <asp:SqlDataSource ID="SqlDSConsulenti" runat="server" ConnectionString="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection %>" SelectCommand="SELECT NULL AS Consulente UNION SELECT cod_pro AS Consulente  FROM dbo.GDN_itvElencoConsulenti() ORDER BY Consulente"></asp:SqlDataSource>
            <asp:SqlDataSource ID="SqlDSGestori" runat="server" ConnectionString="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection %>" SelectCommand="SELECT NULL AS Gestore UNION SELECT cod_ges AS Gestore  FROM dbo.GDN_itvElencoGestori() ORDER BY Gestore"></asp:SqlDataSource>
        </div>
    </form>
</body>
</html>
