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

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

<%@ Register assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web" tagprefix="dx" %>
<%--<%@ Register Src="~/MemberPages/menu.ascx" TagPrefix="mc" TagName="menuControl" %>--%>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
<%--    <div>
        <mc:menuControl ID="menu" runat="server" GridID="CERTIFICATESPAGE" Visible="True" />
    </div>--%>
    <div>
    
<dx:ASPxGridView ID="gvElencoProxy" runat="server" AutoGenerateColumns="False" EnableTheming="True" KeyFieldName="IDProxylist" Theme="MetropolisBlue" OnRowDeleting="gvElencoProxy_RowDeleting" OnRowInserting="gvElencoProxy_RowInserting" OnRowUpdating="gvElencoProxy_RowUpdating">
<SettingsAdaptivity>
<AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
</SettingsAdaptivity>

            <SettingsPager PageSize="100">
                <PageSizeItemSettings Visible="True" ShowAllItem="True">
                </PageSizeItemSettings>
            </SettingsPager>
            <Settings ShowFilterRow="True" ShowHeaderFilterButton="True" ShowFilterBar="Visible" />
            <SettingsBehavior ConfirmDelete="True" />
            <SettingsFilterControl ViewMode="VisualAndText">
            </SettingsFilterControl>            

<EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
            <Columns>
                <dx:GridViewCommandColumn ShowDeleteButton="True" ShowEditButton="True" ShowNewButtonInHeader="True" VisibleIndex="0">
                </dx:GridViewCommandColumn>
                <dx:GridViewDataTextColumn FieldName="IDProxylist" ReadOnly="True" VisibleIndex="1">
                    <EditFormSettings Visible="False" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="cod_tit_originale" VisibleIndex="2">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="isin_originale" VisibleIndex="3">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="descrizione_originale" VisibleIndex="4">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="cod_tit_proxy" VisibleIndex="5">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="isin_proxy" VisibleIndex="6">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="descrizione_proxy" VisibleIndex="7">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataDateColumn FieldName="scadenza" VisibleIndex="8">
                    <PropertiesDateEdit DisplayFormatString="dd/MM/yyyy" EditFormat="Custom" EditFormatString="dd/MM/yyyy">
                    </PropertiesDateEdit>
                </dx:GridViewDataDateColumn>
            </Columns>
        </dx:ASPxGridView>
    </div>
        <asp:SqlDataSource ID="SqlDSProxyList" runat="server" ConnectionString="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.MySqlConnection %>" InsertCommand="INSERT INTO olympia_proxylist
           ([cod_tit_originale],[isin_originale] ,[descrizione_originale] ,[cod_tit_proxy] ,[isin_proxy],[descrizione_proxy],data_ins,scadenza)
     VALUES
           (@cod_tit_originale ,@isin_originale,@descrizione_originale,@cod_tit_proxy,@isin_proxy,@descrizione_proxy,curdate(),@scadenza)" ProviderName="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.MySqlConnection.ProviderName %>" SelectCommand="select * from olympia_proxylist" UpdateCommand="	UPDATE olympia_proxylist 
	SET cod_tit_originale = @cod_tit_originale,
		isin_originale = @isin_originale,
		descrizione_originale = @descrizione_originale,
		cod_tit_proxy = @cod_tit_proxy,
		isin_proxy = @isin_proxy,
		descrizione_proxy = @descrizione_proxy,
        data_mod=CURDATE(),
        scadenza=@scadenza
	WHERE IDProxylist = @IDProxylist" DeleteCommand="DELETE olympia_proxylist
WHERE IDProxylist = @IDProxylist">
            <DeleteParameters>
                <asp:Parameter Name="IDProxylist" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="cod_tit_originale" Type="String" />
                <asp:Parameter Name="isin_originale" Type="String" />
                <asp:Parameter Name="descrizione_originale" Type="String" />
                <asp:Parameter Name="cod_tit_proxy" Type="String" />
                <asp:Parameter Name="isin_proxy" Type="String" />
                <asp:Parameter Name="descrizione_proxy" Type="String" />
                <asp:Parameter DbType="Date" Name="scadenza" />
            </InsertParameters>
            <SelectParameters>
                <asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
            </SelectParameters>
            <UpdateParameters>
                <asp:Parameter Name="IDProxylist" Type="Int32" />
                <asp:Parameter Name="cod_tit_originale" Type="String" />
                <asp:Parameter Name="isin_originale" Type="String" />
                <asp:Parameter Name="descrizione_originale" Type="String" />
                <asp:Parameter Name="cod_tit_proxy" Type="String" />
                <asp:Parameter Name="isin_proxy" Type="String" />
                <asp:Parameter Name="descrizione_proxy" Type="String" />
                <asp:Parameter DbType="Date" Name="scadenza" />
            </UpdateParameters>
        </asp:SqlDataSource>
    </form>
</body>
</html>
