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


    <h2>Completed repairs not yet invoiced</h2>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    

    <p>
        Select Customer:
        <asp:DropDownList ID="DDCusts" runat="server" DataSourceID="SqlDatacusts" 
            DataTextField="OrganizationName" DataValueField="CustomerID" 
            AutoPostBack="True" onselectedindexchanged="DropDownList1_SelectedIndexChanged">
        </asp:DropDownList>
        &nbsp;<asp:Button ID="btGen" runat="server" onclick="btGen_Click" 
            Text="Generate Invoices" />
        <asp:Button ID="BClear" runat="server" onclick="BClear_Click" 
            Text="Clear Filter" />
        <asp:SqlDataSource ID="SqlDatacusts" runat="server" 
            ConnectionString="<%$ ConnectionStrings:PirTickets %>" 
            SelectCommand="SELECT [CustomerID], [OrganizationName] FROM [vwCustomerswithRepairsNotYetInvoiced]">
        </asp:SqlDataSource>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AutoGenerateColumns="False" CellPadding="4" DataKeyNames="OrderID" 
            DataSourceID="SqlDataInvoice" ForeColor="#333333" 
            onpageindexchanged="GridView1_PageIndexChanged" Width="720px" 
            PageSize="20" ShowFooter="True">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:BoundField DataField="OrderID" HeaderText="ID" ReadOnly="True" 
                    SortExpression="OrderID" />
                <asp:BoundField DataField="OrganizationName" HeaderText="Company" 
                    SortExpression="OrganizationName" />
                <asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
                <asp:BoundField DataField="manufacturer" HeaderText="Manufacturer" 
                    SortExpression="manufacturer" />
                <asp:BoundField DataField="ModelName" HeaderText="Model" 
                    SortExpression="ModelName" />
                <asp:BoundField DataField="SerialNumber" HeaderText="Serial" 
                    SortExpression="SerialNumber" />
                <asp:BoundField DataField="DateCompleted" DataFormatString="{0:dd MMM yyyy}" 
                    HeaderText="Completed" ReadOnly="True" SortExpression="DateCompleted" />
                <asp:BoundField DataField="AmountBilled" HeaderText="Cost" 
                    SortExpression="AmountBilled" />
            </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>
    </p>
    <p>
   
        <asp:SqlDataSource ID="SqlDataInvoice" runat="server" 
            ConnectionString="<%$ ConnectionStrings:PirTickets %>" 
            
            SelectCommand="SELECT [OrderID], [OrganizationName], [City], [manufacturer], [ModelName], [SerialNumber], [DateCompleted], [TotalCost],[AmountBilled], CustomerID  FROM [vwCompletedRepairsNotInvoiced]" 
>
        </asp:SqlDataSource>
   
    </p>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
