<%@ Page Title="" Language="C#" MasterPageFile="~/Master/MasterPage.master" AutoEventWireup="true" CodeBehind="TicketsforCustomer.aspx.cs" Inherits="PirTickets.TicketsforCustomer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Label ID="Label1" runat="server" Text="These are the repairs you have outstanding:"></asp:Label>
    <br />
    <br />
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
    AutoGenerateSelectButton="True" DataKeyNames="OrderID" 
        onselectedindexchanged="GridView1_SelectedIndexChanged" 
    Width="718px" AllowSorting="True" 
        AutoGenerateColumns="False" DataSourceID="SqlDataCustTickets" 
        EmptyDataText="No repairs to view" CellPadding="4" 
    ForeColor="#333333" ShowFooter="True">
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <Columns>
            <asp:BoundField DataField="OrderID" HeaderText="OrderID" ReadOnly="True" 
                SortExpression="OrderID" />
            <asp:BoundField DataField="manufacturer" HeaderText="Make" 
                SortExpression="manufacturer" />
            <asp:BoundField DataField="ModelName" HeaderText="Model" 
                SortExpression="ModelName" />
            <asp:BoundField DataField="SerialNumber" HeaderText="Serial" 
                SortExpression="SerialNumber" />
            <asp:BoundField DataField="Received" HeaderText="Received" ReadOnly="True" 
                SortExpression="Received" />
            <asp:CheckBoxField DataField="RepairCompleted" HeaderText="Completed" 
                SortExpression="RepairCompleted" />
            <asp:BoundField DataField="priority_name" HeaderText="Priority" 
                SortExpression="priority_name" />
            <asp:BoundField DataField="status_name" HeaderText="Status" 
                SortExpression="status_name" />
        </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="SqlDataCustTickets" runat="server" 
        ConnectionString="<%$ ConnectionStrings:PirTickets %>" 
        SelectCommand="SELECT [OrderID], [manufacturer], [ModelName], [SerialNumber], [Received], [RepairCompleted], [priority_name], [status_name] FROM [vwCustomerTickets] WHERE (RepairCompleted is null or RepairCompleted =0) and ([CustomerID] = @CustomerID)">
        <SelectParameters>
            <asp:QueryStringParameter Name="CustomerID" QueryStringField="custid" 
                Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:Button ID="btBack" runat="server" Text="Back" onclick="btBack_Click" 
    style="width: 46px" />
</asp:Content>
