<%@ Page Title="" Language="C#" MasterPageFile="~/Master/MasterPage.master" AutoEventWireup="true" CodeBehind="PartsCategoryList.aspx.cs" Inherits="PirTickets.PartsCategoryList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<h1>Parts Categories</h1>
    <p>
        <asp:GridView ID="GridView1" runat="server" CellPadding="4" 
            DataSourceID="SqlDataSource1" ForeColor="#333333" 
            AutoGenerateColumns="False" DataKeyNames="id" 
            EmptyDataText="No Parts Categories have been created">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
                    ReadOnly="True" SortExpression="id" />
                <asp:BoundField DataField="categoryname" HeaderText="categoryname" 
                    SortExpression="categoryname" />
                <asp:BoundField DataField="description" HeaderText="description" 
                    SortExpression="description" />
            </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 %>" 
            DeleteCommand="DELETE FROM [partscategory] WHERE [id] = @id" 
            InsertCommand="INSERT INTO [partscategory] ([categoryname], [description]) VALUES (@categoryname, @description)" 
            SelectCommand="SELECT [id], [categoryname], [description] FROM [partscategory]" 
            UpdateCommand="UPDATE [partscategory] SET [categoryname] = @categoryname, [description] = @description WHERE [id] = @id">
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="categoryname" Type="String" />
                <asp:Parameter Name="description" Type="String" />
                <asp:Parameter Name="id" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="categoryname" Type="String" />
                <asp:Parameter Name="description" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
    </p>

</asp:Content>
