<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Reconciliator.aspx.cs" Inherits="OlympiaIntranet.Reconciliator" UICulture="it" Culture="it-IT" %>
<%@ 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>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <dx:ASPxFormLayout ID="ASPxFormLayout1" runat="server" ColCount="2" EnableTheming="True" Theme="Aqua" ColumnCount="2">
                <Items>
                    <dx:LayoutGroup Caption="Upload Area" ColCount="2" ColSpan="1" ColumnCount="2">
                        <Items>
                            <dx:LayoutItem Caption="Banca" ColSpan="1">
                                <LayoutItemNestedControlCollection>
                                    <dx:LayoutItemNestedControlContainer runat="server">
                                        <dx:ASPxRadioButtonList ID="rblBanca" runat="server" RepeatDirection="Horizontal" EnableTheming="True" OnSelectedIndexChanged="rblBanca_SelectedIndexChanged" Theme="Aqua" AutoPostBack="True">
                                            <Items>
                                                <dx:ListEditItem Text="Banca Sella" Value="BS" />
                                                <dx:ListEditItem Text="UBS" Value="UBSI" />
                                            </Items>
                                        </dx:ASPxRadioButtonList>
                                    </dx:LayoutItemNestedControlContainer>
                                </LayoutItemNestedControlCollection>
                            </dx:LayoutItem>
                            <dx:LayoutItem Caption="Portafoglio" ColSpan="1">
                                <LayoutItemNestedControlCollection>
                                    <dx:LayoutItemNestedControlContainer runat="server">
                                        <dx:ASPxGridLookup ID="gridlookupPortafogli" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDSPortafogli" EnableTheming="True" KeyFieldName="KeyID" TextFormatString="{0}" Theme="Aqua">
                                            <GridViewProperties>
                                                <SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" />
                                            </GridViewProperties>
                                            <Columns>
                                                <dx:GridViewDataTextColumn Caption="Portafoglio" FieldName="cod_rap" ShowInCustomizationForm="True" VisibleIndex="0">
                                                </dx:GridViewDataTextColumn>
                                                <dx:GridViewDataTextColumn Caption="Descrizione" FieldName="des_rap" ShowInCustomizationForm="True" VisibleIndex="1">
                                                </dx:GridViewDataTextColumn>
                                            </Columns>
                                        </dx:ASPxGridLookup>
                                    </dx:LayoutItemNestedControlContainer>
                                </LayoutItemNestedControlCollection>
                            </dx:LayoutItem>
                            <dx:LayoutItem Caption="Upload file" ColSpan="1">
                                <LayoutItemNestedControlCollection>
                                    <dx:LayoutItemNestedControlContainer runat="server">
                                        <dx:ASPxUploadControl ID="uploadControl" runat="server" Height="23px" ShowProgressPanel="True" ShowUploadButton="True" Theme="Aqua" UploadMode="Auto" Width="325px" AutoStartUpload="True" OnFileUploadComplete="uploadControl_FileUploadComplete" FileUploadMode="OnPageLoad">
                                            <AdvancedModeSettings EnableDragAndDrop="True" EnableFileList="True" EnableMultiSelect="True">
                                            </AdvancedModeSettings>
                                        </dx:ASPxUploadControl>
                                    </dx:LayoutItemNestedControlContainer>
                                </LayoutItemNestedControlCollection>
                            </dx:LayoutItem>
<%--                            <dx:LayoutItem Caption="" ColSpan="1">
                                <LayoutItemNestedControlCollection>
                                    <dx:LayoutItemNestedControlContainer runat="server">
                                        <dx:ASPxButton ID="btnImportaFlussoBanca" runat="server" OnClick="btnImportaFlussoBanca_Click" Text="Importa flusso banca">
                                            <Image IconID="programming_technology_16x16">
                                            </Image>
                                        </dx:ASPxButton>
                                    </dx:LayoutItemNestedControlContainer>
                                </LayoutItemNestedControlCollection>
                            </dx:LayoutItem>--%>
                            <dx:LayoutItem Caption="" ColSpan="1">
                                <LayoutItemNestedControlCollection>
                                    <dx:LayoutItemNestedControlContainer runat="server">
                                        <dx:ASPxButton ID="btnRilevaMismatch" runat="server" OnClick="btnRilevaMismatch_Click" Text="Rileva mismatch ">
                                            <Image IconID="arrows_next_16x16">
                                            </Image>
                                        </dx:ASPxButton>
                                    </dx:LayoutItemNestedControlContainer>
                                </LayoutItemNestedControlCollection>
                            </dx:LayoutItem>
                        </Items>
                    </dx:LayoutGroup>
                </Items>
            </dx:ASPxFormLayout>
        </div>
       <dx:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" HeaderText="Output" Theme="Aqua" View="GroupBox" Width="100%">
            <PanelCollection>
                <dx:PanelContent runat="server">
<%--                    <dx:ASPxRoundPanel ID="ASPxRoundPanel3" runat="server" HeaderText="Output" Theme="Aqua" View="GroupBox" Width="100%">
                        <PanelCollection>
                            <dx:PanelContent runat="server">
                                <dx:ASPxGridView ID="gvOutput" runat="server"  Theme="Aqua" Width="100%">
                                    <SettingsAdaptivity>
                                        <AdaptiveDetailLayoutProperties ColCount="1">
                                        </AdaptiveDetailLayoutProperties>
                                    </SettingsAdaptivity>
                                    <EditFormLayoutProperties ColCount="1">
                                    </EditFormLayoutProperties>
                                </dx:ASPxGridView>
                            </dx:PanelContent>
                        </PanelCollection>
                    </dx:ASPxRoundPanel>--%>
                    <dx:ASPxGridView ID="gvPtfMerged" runat="server" AutoGenerateColumns="False" KeyFieldName="KeyID" OnHtmlRowPrepared="gvPtfMerged_HtmlRowPrepared" Theme="Aqua" Width="100%">
                        <SettingsPager Mode="ShowAllRecords" Visible="False">
                        </SettingsPager>
                        <Columns>
                            <dx:GridViewDataTextColumn FieldName="KeyID" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="0">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="progr" ShowInCustomizationForm="True" VisibleIndex="1">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="PortafoglioGDN" ShowInCustomizationForm="True" VisibleIndex="2">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="ImportoGDN" ShowInCustomizationForm="True" VisibleIndex="3">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataDateColumn FieldName="DataValutaGDN" ShowInCustomizationForm="True" VisibleIndex="4">
                            </dx:GridViewDataDateColumn>
                            <dx:GridViewDataDateColumn FieldName="DataOperazioneGDN" ShowInCustomizationForm="True" VisibleIndex="5">
                            </dx:GridViewDataDateColumn>
                            <dx:GridViewDataTextColumn FieldName="DescrizioneGDN" ShowInCustomizationForm="True" VisibleIndex="6">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="ImportoBanca" ShowInCustomizationForm="True" VisibleIndex="7">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataDateColumn FieldName="DataValutaBanca" ShowInCustomizationForm="True" VisibleIndex="8">
                            </dx:GridViewDataDateColumn>
                            <dx:GridViewDataDateColumn FieldName="DataOperazioneBanca" ShowInCustomizationForm="True" VisibleIndex="9">
                            </dx:GridViewDataDateColumn>
                            <dx:GridViewDataTextColumn FieldName="DescrizioneBanca" ShowInCustomizationForm="True" VisibleIndex="10">
                            </dx:GridViewDataTextColumn>
                        </Columns>
                    </dx:ASPxGridView>
                </dx:PanelContent>
            </PanelCollection>
        </dx:ASPxRoundPanel>
        <dx:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" GridViewID="gvOutput">
        </dx:ASPxGridViewExporter>
        <asp:SqlDataSource ID="SqlDSPortafogli" runat="server" ConnectionString="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection %>" SelectCommand="GDN_Reconciliator_LoadPtf" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:SessionParameter Name="cod_ctp" SessionField="cod_ctp" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDSPtfMerged" runat="server" ConnectionString="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection %>" SelectCommand="GDN_Reconciliator_MergePtf1" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:SessionParameter Name="cod_rap" SessionField="cod_rap" />
                <asp:SessionParameter Name="cod_ctp" SessionField="cod_ctp" />
            </SelectParameters>
        </asp:SqlDataSource>
    </form>
</body>
</html>
