<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" EnableEventValidation="false" CodeBehind="AssignmentHistory.aspx.cs" Inherits="VMT.AssignmentHistory" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="resource_gallery/js/ShowHide.js"></script>
    <style type="text/css">
        .auto-style2 {
            width: 100%;
            padding: 3px;
        }

        .auto-style3 {
            width: 100%;
            border: 1px solid #014567;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphJavaScriptContentPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphPageTitleContentPlaceHolder" runat="server">
    <div id="CssPageTitle">
        <h1>Assignment History
        </h1>
    </div>
    <div id="SubPageTitle">
        <!-- OPTIONAL SUB PAGE TITLE -->

    </div>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="cphMainContentPlaceHolder" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
            <div id="loaderdiv">
                <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel2" DynamicLayout="true">
                    <ProgressTemplate>

                        <img src="resource_gallery/graphics/loader.gif" class="ajax-loader">
                    </ProgressTemplate>
                </asp:UpdateProgress>

            </div>
           <div style="text-align:right;"><a href="default.aspx">Home</a> <strong>&#8249;&#8249;</strong> <a href="History.aspx">Reports</a> <strong>&#8249;&#8249;</strong> Assignment History</div>
            <div style="text-align: left; width: 100%;">
                <fieldset class="masterform">
                    <legend>Select Company</legend>
                    <div style="width: 100%; height: 60px;">

                        <table class="auto-style2">
                            <tr>
                                <td style="width: 25%">Business Unit</td>
                                <td style="width: 25%">Year</td>

                                <td style="width: 25%">Project/Event</td>
                                <td style="width: 25%">Company</td>
                                <td style="width: 25%" rowspan="2"></td>
                            </tr>
                            <tr>
                                <td style="width: 25%">
                                    <asp:DropDownList ID="ddl_Bunit" runat="server" AutoPostBack="True" OnDataBound="ddl_Bunit_DataBound" OnSelectedIndexChanged="ddl_Bunit_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </td>
                                <td style="width: 25%">
                                    <asp:DropDownList ID="ddl_Year" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddl_Year_SelectedIndexChanged" OnDataBound="ddl_Year_DataBound">
                                    </asp:DropDownList>
                                </td>

                                <td style="width: 25%">
                                    <asp:DropDownList ID="ddlEventCode" runat="server" AutoPostBack="true" OnDataBound="ddlEventCode_DataBound" OnSelectedIndexChanged="ddlEventCode_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </td>
                                <td style="width: 25%">
                                    <asp:DropDownList ID="ddl_Company" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddl_Company_SelectedIndexChanged" OnDataBound="ddl_Company_DataBound">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                        </table>

                    </div>
                </fieldset>
            </div>
            <div style="text-align: left; width: 100%;">
                <fieldset class="masterform">
                    <legend>Project Company Rate List</legend>


                    <asp:GridView ID="gdv_Rate_Company" runat="server" BorderColor="#014567" CellPadding="3" Width="100%"  AutoGenerateColumns="False" 
                        OnSelectedIndexChanged="gdv_Rate_Company_SelectedIndexChanged" OnRowCreated="gdv_Rate_Company_RowCreated" OnRowDataBound="gdv_Rate_Company_RowDataBound" ShowFooter="True">
                        <AlternatingRowStyle BackColor="#E9EFF2" />
                        <Columns>                            
                             <asp:CommandField HeaderText="View" SelectText="" SelectImageUrl="resource_gallery/graphics/payment.png"
                                  ShowSelectButton="True" ButtonType="Image" ItemStyle-HorizontalAlign="Center" Visible="False" >
                                  <ItemStyle HorizontalAlign="Center" />
                             </asp:CommandField>
                             <asp:BoundField DataField="Company" HeaderText="Company">
                                <ItemStyle Width="30%" />
                            </asp:BoundField>
                            
                            <asp:BoundField DataField="RATE_TYPE_NAME" HeaderText="RATETYPE">
                                <ItemStyle Width="30%" />
                            </asp:BoundField>
                             <asp:BoundField DataField="UOM" HeaderText="UOM">
                                <ItemStyle Width="30%" />
                            </asp:BoundField> 
                            <asp:BoundField DataField="SKIPPED_MILES" HeaderText="SKIPPEDMILES">
                                <ItemStyle Width="30%"  HorizontalAlign="Right" />
                            </asp:BoundField>          
                            <asp:BoundField DataField="NONBILLABLE_MILES" HeaderText="NONBILLABLEMILES">
                                <ItemStyle Width="30%"  HorizontalAlign="Right" />
                            </asp:BoundField>                                            
                            <asp:BoundField DataField="BILLABLE_MILES" HeaderText="BILLABLEMILES">
                                <ItemStyle Width="30%" HorizontalAlign="Right" />
                            </asp:BoundField>                            
                            <asp:BoundField DataField="BILLABLE" HeaderText="BILLABLE">
                                <ItemStyle Width="30%"  HorizontalAlign="Right" />
                            </asp:BoundField>
                            <asp:BoundField DataField="RATE_TYPE_ID" HeaderText="RATE_TYPE_ID"></asp:BoundField>
                        </Columns>
                        <HeaderStyle BackColor="#98C8DE" Font-Bold="True" />
                        <SelectedRowStyle BackColor="#FFE98F" />
                    </asp:GridView>
            </div>

            <div style="text-align: left; width: 100%;">
                <fieldset class="masterform">
                    <div style="width: 100%; height: 40px;">

                        <table class="auto-style2">
                            <tr>


                                <td style="width: 20%" rowspan="2">
                                    <asp:Button ID="btn_expExcel" runat="server" CssClass="FormButton" Text="Export to Excel" OnClick="btn_expExcel_Click" Visible="False" />
                                </td>

                            </tr>

                        </table>

                    </div>
                </fieldset>
            </div>


            <div style="text-align: left; width: 100%;">
                <fieldset class="masterform">
                    <legend>Section/WA - Company Rate List</legend>

            <div style="width: 100%; height: 200px; overflow-y: scroll;">


                        <asp:GridView ID="gdv_Rate_Company_Wa" runat="server" BorderColor="#014567" CellPadding="3" Width="100%"
                            AutoGenerateColumns="false">
                            <AlternatingRowStyle BackColor="#E9EFF2" />
                            <Columns>
                                <asp:BoundField DataField="EVENT_CODE" HeaderText="Project/Event"> <ItemStyle Width="30%" /> </asp:BoundField>   
                                    <asp:BoundField DataField="WORK_AREA_ID" HeaderText="Section/WA"> <ItemStyle Width="30%" /> </asp:BoundField>
                                          <asp:BoundField DataField="COMPANY" HeaderText="COMPANY"> <ItemStyle Width="30%" /> </asp:BoundField>
                                                <asp:BoundField DataField="RATE_TYPE" HeaderText="RATETYPE"> <ItemStyle Width="30%" /> </asp:BoundField>
                                <asp:BoundField DataField="SKIPPED_MILES" HeaderText="SKIPPEDMILES">
                                <ItemStyle Width="30%" />
                            </asp:BoundField>
                            
                            <asp:BoundField DataField="BILLABLE_MILES" HeaderText="BILLABLEMILES">
                                <ItemStyle Width="30%" />
                            </asp:BoundField>
                            
                            <asp:BoundField DataField="BILLABLE" HeaderText="BILLABLE">
                                <ItemStyle Width="30%" />
                            </asp:BoundField>
                                
                            </Columns>
                            <HeaderStyle BackColor="#98C8DE" Font-Bold="True" />
                            <SelectedRowStyle BackColor="#FFE98F" />
                           
                        </asp:GridView>


                    </div>
                </fieldset>
            </div>
            <div style="text-align: left; width: 100%;">
                <fieldset class="masterform">
                    <div style="width: 100%; height: 40px;">

                        <table class="auto-style2">
                            <tr>


                                <td style="width: 20%" rowspan="2">
                                    <asp:Button ID="btnEXcelRateCmpWA" runat="server" CssClass="FormButton" Text="Export to Excel" OnClick="btnEXcelRateCmpWA_Click" Visible="False" />
                                </td>

                            </tr>

                        </table>

                    </div>
                </fieldset>
            </div>


    <div style="text-align: left; width: 100%;">
                <fieldset class="masterform">
                    <legend>Project/Event - Section/WA - Company Payment List</legend>
            <div style="width: 100%; height: 200px; overflow-y: scroll;">
                        <asp:GridView ID="gdv_ev_wa_payment_hist" runat="server" BorderColor="#014567" CellPadding="3" Width="100%"
                            AutoGenerateColumns="false">
                            <AlternatingRowStyle BackColor="#E9EFF2" />
                            <Columns>
                                <asp:BoundField DataField="EVENT_CODE" HeaderText="Project/Event"> <ItemStyle Width="30%" /> </asp:BoundField> 
                                    <asp:BoundField DataField="work_area" HeaderText="Section/WA"> <ItemStyle Width="30%" /> </asp:BoundField> 
                                        <asp:BoundField DataField="Company_name" HeaderText="COMPANY"> <ItemStyle Width="30%" /> </asp:BoundField>  
                                             <asp:BoundField DataField="payment_date" HeaderText="PAYMENTDATE" DataFormatString="{0:MM/dd/yyyy}" > <ItemStyle Width="30%" /> </asp:BoundField>                                    
                                                <asp:BoundField DataField="payment_amount" HeaderText="PAYMENT_AMOUNT"> <ItemStyle Width="30%" /> </asp:BoundField>
                                
                                
                            </Columns>
                            <HeaderStyle BackColor="#98C8DE" Font-Bold="True" />
                            <SelectedRowStyle BackColor="#FFE98F" />
                           
                        </asp:GridView>


                    </div>
                </fieldset>
            </div>
            <div style="text-align: left; width: 100%;">
                <fieldset class="masterform">
                    <div style="width: 100%; height: 40px;">

                        <table class="auto-style2">
                            <tr>


                                <td style="width: 20%" rowspan="2">
                                    <asp:Button ID="btnEXcelPaymentHist" runat="server" CssClass="FormButton" Text="Export to Excel" OnClick="btnEXcelPaymentHist_Click"  Visible="False" />
                                </td>

                            </tr>

                        </table>

                    </div>
                </fieldset>
            </div>
            
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
