<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" EnableEventValidation="false" CodeBehind="ProjectCompletionStatus.aspx.cs" Inherits="VMT.ProjectCompletionStatus" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .grd-emptydatatext {
            direction:ltr;
            left: 10px;
        }
    </style>
   
                             <script type="text/javascript">
                                function LoadScript() {
        var strCook = document.cookie;
        if (strCook.indexOf("!~") != 0) {
            var intS = strCook.indexOf("!~");
            var intE = strCook.indexOf("~!");
            var strPos = strCook.substring(intS + 2, intE);
            document.getElementById("grdWithScroll").scrollTop = strPos;
          
        }
    }
    function SetDivPosition() {
        var intY = document.getElementById("grdWithScroll").scrollTop;
        document.cookie = "yPos=!~" + intY + "~!";
        
    }
</script>
</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 Completion Status
        </h1>
    </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>
              <script type="text/javascript">
                    Sys.Application.add_load(LoadScript);
     </script>
               <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="CurrentYTD.aspx">Current</a> <strong>&#8249;&#8249;</strong> Project Completion Status</div>
                        <div >





             <fieldset class="masterform">
                <legend>Project Completion Status</legend> 
                <div style=" width: 100%; height:320px; ">
                    <table>
                        <tr>
                            <td> Business Unit:
                                <asp:DropDownList ID="ddlBUnit" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlBUnit_SelectedIndexChanged">
                                </asp:DropDownList>
                            </td>
                           
                            <td> Project/Event:
                                <asp:DropDownList ID="ddlEventCode" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlEventCode_SelectedIndexChanged" OnDataBound="ddlEventCode_DataBound">
                                </asp:DropDownList>
                            </td>
                             <td> Section/WA:
                                <asp:DropDownList ID="ddlWorkArea" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlWorkArea_SelectedIndexChanged" OnDataBound="ddlWorkArea_DataBound">  
                                </asp:DropDownList>
                            </td>
                             <td>Company:
                                <asp:DropDownList ID="ddlCompany" runat="server" AutoPostBack="true" OnDataBound="ddlCompany_DataBound" OnSelectedIndexChanged="ddlCompany_SelectedIndexChanged">
                                </asp:DropDownList>
                            </td>
                        </tr>
                    </table>
                    <br />
                     <div style=" width: 99%; overflow-x: scroll; position: relative; " > <br />
               <div id="grdWithScroll" onscroll="SetDivPosition()" style="width: 1230px; height: 240px; overflow-y: scroll;"  > <br />
               <asp:GridView ID="gdvWorkArea" runat="server"  HeaderStyle-CssClass="FixedHeaderlong"   BorderColor="#014567" CellPadding="3"  
                     AutoGenerateColumns="False" OnSorting="gdvWorkArea_Sorting"
                      AllowSorting="True" OnRowCommand="gdvWorkArea_RowCommand" >
                    <AlternatingRowStyle BackColor="#E9EFF2" />
                   <EmptyDataTemplate>
                       No data in the data source.
                   </EmptyDataTemplate>
                   <EmptyDataRowStyle CssClass = "grd-emptydatatext"/>
                    <Columns>
                        <asp:TemplateField HeaderStyle-Width="31px" ItemStyle-Width="30px">
                            <ItemTemplate>
                                <asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="False" CommandName="Select" CommandArgument='<%# Bind("line_id") %>' ImageUrl="resource_gallery/graphics/payment.png" Text="" />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField SortExpression="EVENT_CODE"  HeaderStyle-Width="220px" ItemStyle-Width="221px">
                            <HeaderTemplate >
                                <asp:LinkButton ID="LinkButton1"  runat="server" Text="PROJECT/EVENT"  CommandName="Sort" CommandArgument="EVENT_CODE" ForeColor="Black"/>
                            </HeaderTemplate>
                            <ItemTemplate >
                                  <%--<a href='MapView_PS.aspx?EVENT_CODE_ID=<%# Eval("EVENT_CODE_ID") %>&nm=<%# Eval("EVENT_CODE") %>' target="_blank">--%> 
                                <a href='<%=System.Configuration.ConfigurationManager.AppSettings["VMSWorkLink"]%>?bu=0&ec=<%# Eval("EVENT_CODE_ID") %>&wa=0&yr=0' target="_blank">   <asp:Label ID="Label2" runat="server" Text='<%# Bind("EVENT_CODE") %>'></asp:Label> </a>
                           </ItemTemplate>
                        </asp:TemplateField>

                         <asp:TemplateField SortExpression="WORK_AREA"    HeaderStyle-Width="90px" ItemStyle-Width="91px" >
                            <HeaderTemplate >
                                <asp:LinkButton ID="LinkButton2"  runat="server" Text="SECTION/WA"  CommandName="Sort" CommandArgument="WORK_AREA" ForeColor="Black"/>
                            </HeaderTemplate>
                            <ItemTemplate  >
                                <%--<a href='MapView_PS.aspx?EVENT_CODE_ID=<%# Eval("EVENT_CODE_ID") %>&WORK_AREA_ID=<%# Eval("WORK_AREA_ID") %>'  target="_blank"> --%> 
                                <a href='<%=System.Configuration.ConfigurationManager.AppSettings["VMSWorkLink"]%>?bu=0&ec=<%# Eval("EVENT_CODE_ID") %>&wa=<%# Eval("WORK_AREA_ID") %>&yr=0' target="_blank"> <asp:Label ID="lblWorkAreaId" runat="server" Text='<%# Bind("WORK_AREA") %>'></asp:Label></a>
                            </ItemTemplate>
                        </asp:TemplateField>

                       
                        <asp:TemplateField SortExpression="line_id"   HeaderStyle-Width="70px" ItemStyle-Width="71px" >
                            <HeaderTemplate>                                      
                                <asp:LinkButton  ID="LinkButton4" runat="server" Text="LINE ID"  CommandName="Sort" CommandArgument="line_id" ForeColor="Black"/>                       
                            </HeaderTemplate >
                            <ItemTemplate>
                                <%--<a href='LocateWA_Map.aspx?LINE_ID=<%# Eval("LINE_ID") %>&nm=<%# ((string)Eval("LINE_DESCRIPTION").ToString()?? string.Empty).Replace("#", "%23")  %>&WkID=<%# Eval("WORK_AREA_ID") %>'  target="_blank">--%>   
                                    <a href='<%=System.Configuration.ConfigurationManager.AppSettings["VMSWorkLink"]%>?bu=0&ec=<%# Eval("EVENT_CODE_ID") %>&wa=<%# Eval("WORK_AREA_ID") %>&line=<%# Eval("LINE_ID") %>&yr=0' target="_blank"><asp:Label ID="lblLineId" runat="server" Text=' <%# Eval("line_id") %>'></asp:Label></a>
                               
                            </ItemTemplate>
                        </asp:TemplateField>

                         <asp:TemplateField SortExpression="line_description"   HeaderStyle-Width="153px" ItemStyle-Width="151px" >
                            <HeaderTemplate>                                      
                                <asp:LinkButton  ID="LinkButton5" runat="server" Text="NAME_OFFICIAL"  CommandName="Sort" CommandArgument="line_description" ForeColor="Black"/>                       
                            </HeaderTemplate >
                            <ItemTemplate>                                <%# Eval("line_description") %>  </ItemTemplate>
                                 
                        </asp:TemplateField>
                        <asp:TemplateField SortExpression="rate_type_name"   HeaderStyle-Width="80px" ItemStyle-Width="81px" >
                            <HeaderTemplate>                                      
                                <asp:LinkButton  ID="LinkButton14" runat="server" Text="TRIM TYPE"  CommandName="Sort" CommandArgument="rate_type_name" ForeColor="Black"/>                       
                            </HeaderTemplate >
                            <ItemTemplate>
                                <%# Eval("rate_type_name") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                         <asp:TemplateField SortExpression="billing_type"   HeaderStyle-Width="90px" ItemStyle-Width="91px" >
                            <HeaderTemplate>                                      
                                <asp:LinkButton  ID="LinkButton34" runat="server" Text="BILL TYPE"  CommandName="Sort" CommandArgument="billing_type" ForeColor="Black"/>                       
                            </HeaderTemplate >
                            <ItemTemplate>
                                <%# Eval("billing_type") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField SortExpression="LENGTH"   HeaderStyle-Width="80px" ItemStyle-Width="81px" >
                            <HeaderTemplate>                                      
                                <asp:LinkButton  ID="LinkButton74" runat="server" Text="MILES"  CommandName="Sort" CommandArgument="LENGTH" ForeColor="Black"/>                       
                            </HeaderTemplate >
                            <ItemTemplate>
                                <%# Eval("LENGTH") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField SortExpression="climbpercentage"   HeaderStyle-Width="70px" ItemStyle-Width="71px" >
                            <HeaderTemplate>                                      
                                <asp:LinkButton  ID="LinkButton15" runat="server" Text="CLIMB %"  CommandName="Sort" CommandArgument="climbpercentage" ForeColor="Black"/>                       
                            </HeaderTemplate >
                            <ItemTemplate>
                                <%# Eval("climbpercentage") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                         <asp:TemplateField SortExpression="TRIM_DATE"   HeaderStyle-Width="90px" ItemStyle-Width="91px">
                            <HeaderTemplate>
                                <asp:LinkButton  ID="LinkButton61" runat="server" Text="TRIMDATE"  CommandName="Sort" CommandArgument="TRIM_DATE" ForeColor="Black"/>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%# Eval("TRIM_DATE") %>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                       <asp:TemplateField SortExpression="Contractor"   HeaderStyle-Width="105px" ItemStyle-Width="106px" >
                            <HeaderTemplate>                                      
                                <asp:LinkButton  ID="LinkButton16" runat="server" Text="CONTRACTOR"  CommandName="Sort" CommandArgument="Contractor" ForeColor="Black"/>                       
                            </HeaderTemplate >
                            <ItemTemplate>
                                <%# Eval("Contractor") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField SortExpression="work_status_description"   HeaderStyle-Width="80px" ItemStyle-Width="81px">
                            <HeaderTemplate>
                                <asp:LinkButton  ID="LinkButton6" runat="server" Text="STATUS"  CommandName="Sort" CommandArgument="work_status_description" ForeColor="Black"/>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%# Eval("work_status_description") %>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle BackColor="#98C8DE" Font-Bold="True" Width="1231px"/>
                    <SelectedRowStyle BackColor="#FFE98F" />
                </asp:GridView>
                    <%--<td> </td> --%>
                </div>

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

     <div style="text-align:left; width: 100%;">
        <fieldset class="masterform">
            <legend>Project Details</legend>
                <div style="height: 240px; overflow-y: scroll;" > <br />
                    <asp:GridView ID="gdv_Paydetail" runat="server" AutoGenerateColumns="False" BorderColor="#014567" CellPadding="3" Width="100%" >
                        <AlternatingRowStyle BackColor="#E9EFF2" />
                        <Columns>
                            <%--<asp:BoundField DataField="WORK_AREA" HeaderText="WORK AREA" />--%>
                            <asp:BoundField DataField="LINE" HeaderText="LINE" >
                            <ItemStyle Width="10%" />
                            </asp:BoundField>
                            <asp:BoundField DataField="COMPANY" HeaderText="COMPANY" >
                            <ItemStyle Width="20%" />
                            </asp:BoundField>
                            <asp:BoundField DataField="trim_date" HeaderText="TRIM DATE" >
                                                       
                            <ItemStyle Width="10%" />
                            </asp:BoundField>

                            <asp:BoundField DataField="TRIMTYPE" HeaderText="TRIM TYPE" >
                            <ItemStyle Width="10%" />
                            </asp:BoundField>
                            <asp:BoundField DataField="CLIMBPERCENTAGE" HeaderText="CLIMB PERCENTAGE" >
                            <ItemStyle Width="10%" />
                            </asp:BoundField>
                            <asp:BoundField DataField="BILLING_TYPE" HeaderText="BILL TYPE" >
                            <ItemStyle Width="10%" />
                            </asp:BoundField>
                            <asp:BoundField DataField="DR_CR_FL" HeaderText="DR_CR_FL" >
                            <ItemStyle Width="10%" />
                            </asp:BoundField>
                            <asp:BoundField DataField="TRANS_DATE" HeaderText="TRANS_DATE" >
                                                       
                            <ItemStyle Width="20%" />
                            </asp:BoundField>

                        </Columns>
                        <HeaderStyle BackColor="#98C8DE" Font-Bold="True" />
                        <SelectedRowStyle BackColor="#FFE98F" />
                    </asp:GridView>
                </div>
            </fieldset>
         </div>


        </div>
        <fieldset class="masterform">
            <div style=" width: 89%; height:42px; ">
            <table>
                <tr>
                    <td>
                        <asp:Button ID="btnExportExcel" runat="server" CssClass="FormButton" OnClick="btnExportExcel_Click" Visible="false" Text="Export To Excel" /></td>
                </tr>
            </table>
            </div>
        </fieldset>
      </ContentTemplate>
       
     </asp:UpdatePanel>
</asp:Content>
