<%@ Page Title="" Language="C#" MasterPageFile="~/Master/MasterPage.master" AutoEventWireup="true" CodeBehind="PaymentMethods.aspx.cs" Inherits="PirTickets.PaymentMethods" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <h2>Payment Terms</h2>
        <asp:Button ID="btAdd" runat="server" Text="Add Payment Terms" 
            onclick="btAdd_Click" />
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
    AllowSorting="True" AutoGenerateColumns="False" AutoGenerateDeleteButton="True" 
    AutoGenerateEditButton="True" DataKeyNames="ID" 
    DataSourceID="SqlDataPaymentMethods" 
    onselectedindexchanged="GridView1_SelectedIndexChanged" Width="464px" 
            CellPadding="4" ForeColor="#333333" ShowFooter="True">
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <Columns>
            <asp:CommandField ShowSelectButton="True" />
            <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                ReadOnly="True" SortExpression="ID" />
            <asp:BoundField DataField="PaymentTerms" HeaderText="Payment Terms" 
                SortExpression="PaymentTerms" />
            <asp:BoundField DataField="NumberOfDays" HeaderText="Number Of Days" 
                SortExpression="NumberOfDays" />
        </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="SqlDataPaymentMethods" runat="server" 
    ConnectionString="<%$ ConnectionStrings:PirTickets %>" 
    SelectCommand="SELECT [ID], [PaymentTerms], [NumberOfDays] FROM [PaymentTerms]"
    UpdateCommand="update [PaymentTerms] set [PaymentTerms] =@PaymentTerms, [NumberOfDays] =@NumberOfDays where ID = @ID"
    DeleteCommand="DELETE FROM [PaymentTerms] where ID = @ID"
    >
</asp:SqlDataSource>
</ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
