<%@ Page Title="" Language="C#" MasterPageFile="~/Master/MasterPage.master" AutoEventWireup="true" CodeBehind="PartsList.aspx.cs" Inherits="PirTickets.PartsList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<h2>Parts Store</h2>
    <p>
        <asp:Button ID="bAdd" runat="server" onclick="bAdd_Click" Text="Add Part" />
    </p>
    <p>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" AutoGenerateSelectButton="True" 
            CellPadding="4" DataKeyNames="id" DataSourceID="SqlDataSource1" 
            EmptyDataText="You have not yet added any parts" ForeColor="#333333" 
            onselectedindexchanged="GridView1_SelectedIndexChanged" ShowFooter="True" 
            Width="750px">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
                    ReadOnly="True" SortExpression="id" />
                <asp:BoundField DataField="partno" HeaderText="partno" 
                    SortExpression="partno" />
                <asp:BoundField DataField="partname" HeaderText="partname" 
                    SortExpression="partname" />
                <asp:BoundField DataField="description" HeaderText="description" 
                    SortExpression="description" />
                <asp:BoundField DataField="quant" HeaderText="quant" SortExpression="quant" />
                <asp:BoundField DataField="reorder" HeaderText="reorder" 
                    SortExpression="reorder" />
            </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:PirTickets %>" 
            SelectCommand="SELECT [id], [partno], [partname], [description], [quant], [reorder] FROM [partsstore]">
        </asp:SqlDataSource>
    </p>

</asp:Content>
