<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:LocalSqlServer %>"
DeleteCommand="DELETE FROM [Car_Productos] WHERE [ProductoID] = @ProductoID"
InsertCommand="INSERT INTO [Car_Productos] ([Titulo], [Descripcion], [CategoriaID], [Precio], [Oferta], [Imagen], [EsPromocion], [Stock], [Baja], [VecesVisto], [VecesComprado], [FechaAlta]) VALUES (@Titulo, @Descripcion, @CategoriaID, @Precio, @Oferta, @Imagen, @EsPromocion, @Stock, @Baja, @VecesVisto, @VecesComprado, @FechaAlta)"
ProviderName="<%$ ConnectionStrings:LocalSqlServer.ProviderName %>"
SelectCommand="SELECT [ProductoID], [Titulo], [Descripcion], [CategoriaID], [Precio], [Oferta], [Imagen], [EsPromocion], [Stock], [Baja], [VecesVisto], [VecesComprado], [FechaAlta] FROM [Car_Productos] WHERE [Baja] ='0'"
UpdateCommand="UPDATE [Car_Productos] SET [Titulo] = @Titulo, [Descripcion] = @Descripcion, [CategoriaID] = @CategoriaID, [Precio] = @Precio, [Oferta] = @Oferta, [Imagen] = @Imagen, [EsPromocion] = @EsPromocion, [Stock] = @Stock, [Baja] = @Baja, [VecesVisto] = @VecesVisto, [VecesComprado] = @VecesComprado, [FechaAlta] = @FechaAlta WHERE [ProductoID] = @ProductoID">
<DeleteParameters>
<asp:Parameter Name="ProductoID" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Titulo" Type="String" />
<asp:Parameter Name="Descripcion" Type="String" />
<asp:Parameter Name="CategoriaID" Type="Int32" />
<asp:Parameter Name="Precio" Type="Decimal" />
<asp:Parameter Name="Oferta" Type="Decimal" />
<asp:Parameter Name="Imagen" Type="String" />
<asp:Parameter Name="EsPromocion" Type="Boolean" />
<asp:Parameter Name="Stock" Type="Decimal" />
<asp:Parameter Name="Baja" Type="Boolean" />
<asp:Parameter Name="VecesVisto" Type="Int32" />
<asp:Parameter Name="VecesComprado" Type="Int32" />
<asp:Parameter DbType="Date" Name="FechaAlta" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Titulo" Type="String" />
<asp:Parameter Name="Descripcion" Type="String" />
<asp:Parameter Name="CategoriaID" Type="Int32" />
<asp:Parameter Name="Precio" Type="Decimal" />
<asp:Parameter Name="Oferta" Type="Decimal" />
<asp:Parameter Name="Imagen" Type="String" />
<asp:Parameter Name="EsPromocion" Type="Boolean" />
<asp:Parameter Name="Stock" Type="Decimal" />
<asp:Parameter Name="Baja" Type="Boolean" />
<asp:Parameter Name="VecesVisto" Type="Int32" />
<asp:Parameter Name="VecesComprado" Type="Int32" />
<asp:Parameter DbType="Date" Name="FechaAlta" />
<asp:Parameter Name="ProductoID" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
<asp:Label ID="Label1" runat="server" Text="<h1><strong>Productos</strong></h1>"></asp:Label>
<br />
<br />
<asp:ListView ID="ListView1" runat="server" DataKeyNames="ProductoID"
DataSourceID="SqlDataSource1" EnableModelValidation="True" GroupItemCount="2">
<AlternatingItemTemplate>
<div id="left">
<div class="prueba"><asp:ImageButton ID="ImageButton2" runat="server" Height="150px" Width="150px" ImageUrl='<%# Eval("Imagen", "~/Carrito/Imagenes/{0}") %>' PostBackUrl='<%# Eval("ProductoID", "~/Carrito/Detalles.aspx?ProductoID={0}") %>' CommandName="Ver"/><br /></DIV>
<div class="info"><asp:Label ID="lblProductoID" runat="server"
Text='<%# Eval("ProductoID") %>' Visible="false"/>
<br />CategoriaID:
<asp:Label ID="CategoriaIDLabel" runat="server"
Text='<%# Eval("CategoriaID") %>' />
<br />Titulo:
<asp:Label ID="lblTitulo" runat="server" Text='<%# Eval("Titulo") %>' />
<br />Descripcion:
<asp:Label ID="DescripcionLabel" runat="server"
Text='<%# IrDescripcion(Eval("Descripcion")) %>' />
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Carrito/Iconos/mas3.png" PostBackUrl='<%# Eval("ProductoID", "Detalles.aspx?ProductoID={0}") %>' ToolTip="Leer más..." CommandArgument='<%# Eval("ProductoID") %>' CommandName="Leermas"/>
<div class="price">Precio:
<asp:Label ID="lblPrecio" runat="server" Text='<%# Eval("Precio", "{0:C}") %>' /> <asp:Label ID="lblOferta" runat="server" Text='<%# Eval("Oferta", "{0:C}") %>' /> <asp:Label
ID="lblPortentaje" runat="server" Text=""></asp:Label>
</DIV>
<div class="actions">Cantidad: <asp:TextBox ID="txtCantidad" runat="server" Text="1" MaxLength="3" Width="25px"></asp:TextBox><asp:ImageButton
ID="ImageButton3" runat="server" imageurl="~/Carrito/Iconos/Carro.png" CommandName="Agregar" CssClass="carro"/></DIV>
<br />
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%# "~/Administrador/Carrito/Entrada.aspx?ProductoID=" & Eval("ProductoID") %>' Visible="false">Editar</asp:HyperLink>
<asp:Label ID="lblSeparador1" runat="server" Text=" | " Visible="false"></asp:Label>
<asp:LinkButton ID="LinkButton4" runat="server" CommandName="Delete" Text="Eliminar" OnClientClick="return confirm('La entrada sera eliminada de forma permannte. ¿Desea borrarla?');" Visible="false"/>
<asp:Label ID="lblSeparador2" runat="server" Text=" | " Visible="false"></asp:Label>
<asp:LinkButton ID="LinkButton5" runat="server" OnClick="LinkButton1_Click" Text="Insertar" Visible="false"/></DIV></DIV>
</AlternatingItemTemplate>
<EditItemTemplate>
</EditItemTemplate>
<EmptyDataTemplate>
<table id="Table1" runat="server" style="">
<tr>
<td>
No se han devuelto datos.</td>
</tr>
</table>
</EmptyDataTemplate>
<EmptyItemTemplate>
<td id="Td1" runat="server" />
</EmptyItemTemplate>
<GroupTemplate>
<tr ID="itemPlaceholderContainer" runat="server">
<td ID="itemPlaceholder" runat="server">
</td>
</tr>
</GroupTemplate>
<InsertItemTemplate>
</InsertItemTemplate>
<ItemTemplate>
<div id="left">
<div class="prueba"><asp:ImageButton ID="ImageButton2" runat="server" Height="150px" Width="150px" ImageUrl='<%# Eval("Imagen", "~/Carrito/Imagenes/{0}") %>' PostBackUrl='<%# Eval("ProductoID", "Detalles.aspx?ProductoID={0}") %>' CommandName="Ver"/><br /></DIV>
<div class="info"><asp:Label ID="lblProductoID" runat="server"
Text='<%# Eval("ProductoID") %>' Visible="false" />
<br />CategoriaID:
<asp:Label ID="CategoriaIDLabel" runat="server"
Text='<%# Eval("CategoriaID") %>' />
<br />Titulo:
<asp:Label ID="lblTitulo" runat="server" Text='<%# Eval("Titulo") %>' />
<br />Descripcion:
<asp:Label ID="DescripcionLabel" runat="server"
Text='<%# IrDescripcion(Eval("Descripcion")) %>' />
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Carrito/Iconos/mas3.png" PostBackUrl='<%# Eval("ProductoID", "Detalles.aspx?ProductoID={0}") %>' ToolTip="Leer más..." CommandArgument='<%# Eval("ProductoID") %>' CommandName="Leermas"/>
<div class="price">Precio:
<asp:Label ID="lblPrecio" runat="server" Text='<%# Eval("Precio", "{0:C}") %>' /> <asp:Label ID="lblOferta" runat="server" Text='<%# Eval("Oferta", "{0:C}") %>' /> <asp:Label
ID="lblPortentaje" runat="server" Text=""></asp:Label>
</DIV>
<div class="actions">Cantidad: <asp:TextBox ID="txtCantidad" runat="server" Text="1" MaxLength="3" Width="25px"></asp:TextBox><asp:ImageButton
ID="ImageButton3" runat="server" imageurl="~/Carrito/Iconos/Carro.png" CommandName="Agregar" CssClass="carro"/><br /></DIV>
<br />
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%# "~/Administrador/Carrito/Entrada.aspx?ProductoID=" & Eval("ProductoID") %>' Visible="false">Editar</asp:HyperLink>
<asp:Label ID="lblSeparador1" runat="server" Text=" | " Visible="false"></asp:Label>
<asp:LinkButton ID="LinkButton4" runat="server" CommandName="Delete" Text="Eliminar" OnClientClick="return confirm('La entrada sera eliminada de forma permannte. ¿Desea borrarla?');" Visible="false"/>
<asp:Label ID="lblSeparador2" runat="server" Text=" | " Visible="false"></asp:Label>
<asp:LinkButton ID="LinkButton5" runat="server" OnClick="LinkButton1_Click" Text="Insertar" Visible="false"/></DIV></DIV>
</ItemTemplate>
<LayoutTemplate>
<table id="Table2" runat="server">
<tr id="Tr1" runat="server">
<td id="Td2" runat="server">
<table ID="groupPlaceholderContainer" runat="server" border="0" style="">
<tr ID="groupPlaceholder" runat="server">
</tr>
</table>
</td>
</tr>
<tr id="Tr2" runat="server">
<td id="Td3" runat="server" style="">
<asp:DataPager ID="DataPager1" runat="server" PageSize="4">
<Fields>
<asp:NextPreviousPagerField ShowNextPageButton="False" ButtonCssClass="previousNextLink" ButtonType="Link" ShowFirstPageButton="True" />
<asp:NumericPagerField ButtonCount="5" ButtonType="Link" NumericButtonCssClass="numericLink" />
<asp:NextPreviousPagerField ShowPreviousPageButton="False" ButtonCssClass="previousNextLink" ButtonType="Link" ShowLastPageButton="True"/>
</Fields>
</asp:DataPager>
</td>
</tr>
</table>
</LayoutTemplate>
<SelectedItemTemplate>
<td id="Td4" runat="server" style="">
ProductoID:
<asp:Label ID="ProductoIDLabel" runat="server"
Text='<%# Eval("ProductoID") %>' />
<br />Titulo:
<asp:Label ID="TituloLabel" runat="server" Text='<%# Eval("Titulo") %>' />
<br />Descripcion:
<asp:Label ID="DescripcionLabel" runat="server"
Text='<%# Eval("Descripcion") %>' />
<br />CategoriaID:
<asp:Label ID="CategoriaIDLabel" runat="server"
Text='<%# Eval("CategoriaID") %>' />
<br />Precio:
<asp:Label ID="PrecioLabel" runat="server" Text='<%# Eval("Precio") %>' />
<br />Oferta:
<asp:Label ID="OfertaLabel" runat="server" Text='<%# Eval("Oferta") %>' />
<br />Imagen:
<asp:Label ID="ImagenLabel" runat="server" Text='<%# Eval("Imagen") %>' />
<br />Stock:
<asp:Label ID="StockLabel" runat="server" Text='<%# Eval("Stock") %>' />
<br />
<asp:CheckBox ID="BajaCheckBox" runat="server" Checked='<%# Eval("Baja") %>'
Enabled="false" Text="Baja" />
<br />
</td>
</SelectedItemTemplate>
</asp:ListView>