<%@ Page Language="C#"  CodeFile="Cart.aspx.cs" Inherits="Default_aspx" %>

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

 

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

    <title>Exforsys shopping cart page</title>

</head>

<body>

    <form id="form1" runat="server">

    <div>

        <table style="width: 719px; height: 435px">

            <tr>

                <td style="width: 100px" >

                    Links:<br />

                    Main<br />

                    Protected Area<br />

                    Admin Area</td>

                <td style="width: 139px">

 

                    <asp:GridView ID="GridView1" runat="server" datakeynames="ProductId" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" Width="568px" Height="206px" AutoGenerateColumns="False" datasourceId="ObjectDatasource1">

                        <Columns>

                            <asp:BoundField ReadOnly="True" HeaderText="Product ID"></asp:BoundField>

                            <asp:BoundField HeaderText="Name of Product"></asp:BoundField>

                            <asp:BoundField HeaderText="Count"></asp:BoundField>

                            <asp:BoundField HeaderText="Unit Price"></asp:BoundField>

                            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True"></asp:CommandField>

                        </Columns>

                       

                       

                        </asp:GridView>

                    <asp:DetailsView ID="DetailsView1" runat="server" datasourceid ="ObjectDataSource1" DefaultMode="Insert" DataKeyNames="ProductId" Width="560px" Height="116px" AutoGenerateRows="False"

                        OnPageIndexChanging="DetailsView1_PageIndexChanging">

                        <Fields>

                            <asp:BoundField ReadOnly="True" HeaderText="Product Id"></asp:BoundField>

                            <asp:BoundField HeaderText="Name of product"></asp:BoundField>

                            <asp:BoundField HeaderText="Count"></asp:BoundField>

                            <asp:BoundField HeaderText="Unit Price"></asp:BoundField>

                            <asp:CommandField ShowInsertButton="True"></asp:CommandField>

                        </Fields>

                    </asp:DetailsView>

                       

<asp:ObjectDataSource

id="ObjectDataSource1"

runat="server"

selectmethod="GetCart"

typename="CartManager"

updatemethod="update"

insertmethod="Insert"

deletemethod="Delete">

 

<updateparameters>

<asp:parameter name="Unitprice" type="Decimal"/>

<asp:parameter name="Count" type="Int32"/>

<asp:parameter name="ProductId" type="Int32" />

</updateparameters>

 

<insertparameters>

<asp:parameter name="ProductId" type="Int32" >

</asp:parameter>

<asp:parameter name="Unitprice" type="Decimal" >

</asp:parameter>

<asp:parameter name="Count" type="Int32" >

</asp:parameter>

<asp:parameter name="Name" type="String" >

</asp:parameter >

</insertparameters>

 

</asp:ObjectDataSource>

 

                </td>

            </tr>

        </table>

   

    </div>

    </form>

</body>

</html>