<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" EnableEventValidation="false" CodeBehind="CycleMgmt.aspx.cs" Inherits="VMT.CycleMgmt" %>
<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;
        }
        </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>
            Project Analysis
        </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="Analysis.aspx">Analysis</a> <strong>&#8249;&#8249;</strong> Project Analysis</div>
     <div id="wrapper" class="clear">
        <div id="left">
            <fieldset class="masterform">
                 <legend>Select Business Unit and Year</legend>
                <div style=" width: 100%; height:60px; ">
                  
                                    
                                    <table class="auto-style2">
                                        <tr>
                                            <td style="width: 25%">Business Unit</td>
                                            <td style="width: 25%">
                                                <asp:DropDownList ID="ddl_Bunit" runat="server" AutoPostBack="True"
                                                    OnSelectedIndexChanged="ddl_Bunit_SelectedIndexChanged"></asp:DropDownList>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 25%">Work Year</td>
                                            <td style="width: 25%">
                                                <asp:DropDownList ID="ddl_Year" runat="server" AutoPostBack="True"
                                                 OnSelectedIndexChanged="ddl_Year_SelectedIndexChanged"></asp:DropDownList>
                                            </td>
                                             <td style="width: 25%" rowspan="2">                                              
                                                <asp:Button ID="btnAdd" runat="server" CssClass="FormButton" OnClick="btn_add_Click" Text="Go" />                                              
                                            </td>
                                          </tr>
                                           
                                        
                                       </table>  
                                  
                </div>
            <div style=" width: 100%; height: 50px;" >
                <tr><td style="width: 25%">Summary</td>
                </tr>  
                <tr>
                    <td >
                        <asp:Button ID="btnRest" runat="server" CssClass="FormButton" OnClick="btnRest_Click" Text="Reset" visible="false"/>
                    </td>
                </tr> 
            </div>

            <div style=" width: 100%; height: 185px; overflow-y: scroll;" > 
                <asp:GridView ID="gdvSummary" runat="server"  BorderColor="#014567" CellPadding="3"  Width="96%"
                     OnRowDataBound="gdvSummary_RowDataBound"
                     AutoGenerateColumns="true" AllowPaging="false" emptydatatext="No data in the data source." 
                    >
                    <AlternatingRowStyle BackColor="#E9EFF2" />
                    <%--<Columns> 
                        <asp:TemplateField>
                            <HeaderTemplate>
                                Year
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%# Eval("Year") %>
                            </ItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField>
                            <HeaderTemplate>
                                Total_Miles                                
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%# Eval("Total_Miles") %>
                            </ItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField>
                            <HeaderTemplate>
                                Total_Amount                               
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%# Eval("Total_Amount") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        
                    </Columns>--%>
                    <HeaderStyle BackColor="#98C8DE" Font-Bold="True"/>
                    <SelectedRowStyle BackColor="#FFE98F" />
                </asp:GridView>
                </div> 

            </fieldset>
        </div>
         
         <div id="right">
             <fieldset class="masterform">
        <legend>Total Miles & Amount</legend> 
                  <asp:Button ID="btnExportExcel" runat="server" CssClass="FormButton" OnClick="btnExportExcel_Click" Text="Export To Excel" Visible="false" />
            <div style=" width: 100%; height:300px;  overflow-y: scroll;">
                <br />
                <asp:GridView ID="gdv_TotMilesAmt" runat="server"  BorderColor="#014567" CellPadding="3" HeaderStyle-CssClass="FixedHeader"
                     AutoGenerateColumns="false" OnSorting="gdv_TotMilesAmt_Sorting" AllowSorting="true"><%--OnRowDataBound="gdv_TotMilesAmt_RowDataBound">--%>

                    <AlternatingRowStyle BackColor="#E9EFF2" />
                    <Columns>
                        <asp:TemplateField   SortExpression="YEAR"  HeaderStyle-Width="56px" ItemStyle-Width="54px">                            
                           <%--<ItemTemplate>
                                <asp:DropDownList ID="ddlYear" runat="server" Text='<%# Bind("Year") %>' 
                                    OnSelectedIndexChanged="ddlYear_SelectedIndexChanged" OnDataBound="ddlYear_DataBound" 
                                    Width="70" AutoPostBack="True"></asp:DropDownList>
                            </ItemTemplate>--%>
                            <HeaderTemplate >
                                <asp:LinkButton ID="LinkButton1"  runat="server" Text="YEAR"  CommandName="Sort" CommandArgument="YEAR" ForeColor="Black"/>
                            </HeaderTemplate>
                            <ItemTemplate >
                                <asp:TextBox ID="txtYear" runat="server" Text='<%# Bind("Year") %>' Width="50px" OnTextChanged="txtYear_TextChanged" AutoPostBack="True"></asp:TextBox>
                            </ItemTemplate>
                            <%--<EditItemTemplate>
                                <asp:TextBox ID="txtYear" runat="server" Text='<%# Bind("YEAR") %>'></asp:TextBox>
                            </EditItemTemplate>--%>
                            <ItemStyle Width="5%" />
                        </asp:TemplateField>
                        <asp:TemplateField  SortExpression="Event_Code" HeaderStyle-Width="106px" ItemStyle-Width="105px"> 
                            <HeaderTemplate >
                                <asp:LinkButton ID="LinkButton2"  runat="server" Text="Project/Event"  CommandName="Sort" CommandArgument="Event_Code" ForeColor="Black"/>
                            </HeaderTemplate>                           
                            <ItemTemplate>
                                <asp:Label ID="Event_Code" runat="server"
                                    Text='<%# Bind("Event_Code") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField SortExpression="Total_Miles" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="90px" ItemStyle-Width="90px">  
                            <HeaderTemplate >
                                <asp:LinkButton ID="LinkButton3"  runat="server" Text="Total_Miles"  CommandName="Sort" CommandArgument="Total_Miles" ForeColor="Black"/>
                            </HeaderTemplate>                           
                            <ItemTemplate >
                                <asp:Label ID="Total_Miles" runat="server"
                                    Text='<%# string.Format("{0:#.000}", Convert.ToDouble(Eval("Total_Miles"))) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                         <asp:TemplateField SortExpression="Total_Amount" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="110px" ItemStyle-Width="110px"> 
                             <HeaderTemplate >
                                <asp:LinkButton ID="LinkButton4"  runat="server" Text="Total_Amount"  CommandName="Sort" CommandArgument="Total_Amount" ForeColor="Black"/>
                            </HeaderTemplate>                            
                            <ItemTemplate>
                                <asp:Label ID="Total_Amount" runat="server"
                                    Text='<%# string.Format("{0:#.00}", Convert.ToDouble(Eval("Total_Amount"))) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                         
                     
                    </Columns>
                    <HeaderStyle BackColor="#98C8DE" Font-Bold="True" />
                    <SelectedRowStyle BackColor="#FFE98F" />
                </asp:GridView>

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

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