<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="SprayOpenForContractorN.aspx.cs" Inherits="VMT.SprayOpenForContractor1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphJavaScriptContentPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphPageTitleContentPlaceHolder" runat="server">
    <div id="CssPageTitle">
        <h1>
           Open Work for Spray Contractor
        </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>
              <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> Open Work for Contractor</div>
                        <div >
             <fieldset class="masterform">
                <legend>Open for Spray Contractor</legend> 
                <div style=" width: 100%; height:300px; ">
                    <table>
                        <tr>
                            <td> Business Unit:
                                <asp:DropDownList ID="ddlBUnit" runat="server" OnSelectedIndexChanged="ddlBUnit_SelectedIndexChanged" AutoPostBack="true">
                                </asp:DropDownList>
                            </td>
                                                        <td> Work Year:
                                <asp:DropDownList ID="ddlYear" runat="server" OnSelectedIndexChanged="ddlYear_SelectedIndexChanged" AutoPostBack="true" OnDataBound="ddlYear_DataBound">
                                </asp:DropDownList>
                            <td/>

                            <td> Project/Event:
                                <asp:DropDownList ID="ddlEventCode" runat="server" OnSelectedIndexChanged="ddlEventCode_SelectedIndexChanged" AutoPostBack="true" OnDataBound="ddlEventCode_DataBound">  
                                </asp:DropDownList>
                            </td>

                             <%--<td> <asp:Button ID="btnGo" runat="server" Text="Go" OnClick="btnGo_Click"  CssClass="FormButton"/></td> --%>
                        </tr>
                    </table>
                    <br />
               <div style=" width: 100%; height: 240px; overflow-y: scroll;" > <br />
                <asp:GridView ID="gdvOpenContractor" runat="server"  BorderColor="#014567" CellPadding="3"  HeaderStyle-CssClass="FixedHeader" 
                     AutoGenerateColumns="false"  emptydatatext="No data in the data source." 
                     OnSorting="gdvOpenContractor_Sorting" AllowSorting="True">
                    <AlternatingRowStyle BackColor="#E9EFF2" />
                    <Columns>
                        <asp:TemplateField SortExpression="EVENT_CODE"   HeaderStyle-Width="251px" ItemStyle-Width="250px"  >
                            <HeaderTemplate>                                      
                                <asp:LinkButton  ID="LinkButton12" runat="server" Text="PROJECT/EVENT"  CommandName="Sort" CommandArgument="EVENT_CODE" ForeColor="Black"/>                       
                            </HeaderTemplate >
                            <ItemTemplate>
                                <a href='LocateWA_Map.aspx?EVENT_CODE_ID=<%# Eval("EVENT_CODE_ID") %>&nm=<%# Eval("EVENT_CODE") %>' 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="101px" ItemStyle-Width="100px">
                            <HeaderTemplate>
                                <asp:LinkButton  ID="LinkButton1" runat="server" Text="SECTION/WA"  CommandName="Sort" CommandArgument="WORK_AREA" ForeColor="Black"/>
                            </HeaderTemplate>
                            <ItemTemplate>
                                 <asp:Label ID="lbl_WORK_AREA_ID" runat="server" Text='<%# Eval("WORK_AREA_ID") %>' Visible="false"></asp:Label>
                                <a href='LocateWA_Map.aspx?WORK_AREA_ID=<%# Eval("WORK_AREA_ID") %>&nm=<%# Eval("WORK_AREA") %>'  target="_blank">   <asp:Label ID="Label1" runat="server" Text='<%# Bind("WORK_AREA") %>'></asp:Label></a>
                            </ItemTemplate>
                        </asp:TemplateField>
                        
                        <asp:TemplateField SortExpression="COMPANY"   HeaderStyle-Width="141px" ItemStyle-Width="140px" >
                            <HeaderTemplate>                                      
                                <asp:LinkButton  ID="LinkButton2" runat="server" Text="COMPANY"  CommandName="Sort" CommandArgument="COMPANY" ForeColor="Black"/>                       
                            </HeaderTemplate >
                            <ItemTemplate>
                                <asp:Label ID="lbl_COMPANY_ID" runat="server" Text='<%# Eval("COMPANY_ID") %>' Visible="false"></asp:Label>
                                <%# Eval("COMPANY") %>
                            </ItemTemplate>
                        </asp:TemplateField>


                         <%--<asp:TemplateField SortExpression="work_status_id"  >
                            <HeaderTemplate>                                      
                                <asp:LinkButton  ID="LinkButton22" runat="server" Text="work_status_id"  CommandName="Sort" CommandArgument="work_status_id" ForeColor="Black"/>                       
                            </HeaderTemplate >
                            <ItemTemplate>
                                <%# Eval("work_status_id") %>
                            </ItemTemplate>
                        </asp:TemplateField>--%>

                        <asp:templatefield HeaderText="OPEN FOR COMPANY"   HeaderStyle-Width="161px" ItemStyle-Width="160px" >                           
                            <HeaderTemplate>
                                 <asp:checkbox ID="cbSelectAll"  runat="server" AutoPostBack="true"  ForeColor="Black" 
                                     OnCheckedChanged="cbSelectAll_CheckedChanged" TextAlign="Left"></asp:checkbox>   OPEN FOR COMPANY
                                </div>                              
                            </HeaderTemplate>
                           <%--  <HeaderStyle  HorizontalAlign="Right" VerticalAlign="Middle" Wrap="False" Width="40px" />--%>
                            <itemtemplate>
                                <asp:checkbox ID="cbSelect"  runat="server" AutoPostBack="true"  
                                   Enabled='<%# Convert.ToBoolean(Eval("open")) %>' 
                                    Checked='<%#Convert.ToBoolean(Eval("work_status_id").ToString()=="4" ) %>'
                                    />                              
                            </itemtemplate>
                           
                            <ItemStyle  HorizontalAlign="Left" VerticalAlign="Middle" />
                        </asp:templatefield>
                        <asp:TemplateField SortExpression="STATUS"   HeaderStyle-Width="140px" ItemStyle-Width="140px" >
                            <HeaderTemplate>                                      
                                <asp:LinkButton  ID="LinkButton3" runat="server" Text="STATUS"  CommandName="Sort" CommandArgument="STATUS" ForeColor="Black"/>                       
                            </HeaderTemplate >
                            <ItemTemplate>
                                <%# Eval("STATUS") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle BackColor="#98C8DE" Font-Bold="True"/>
                    <SelectedRowStyle BackColor="#FFE98F" />
                </asp:GridView>
                    <td> </td> 
                </div>

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

        <div style="text-align:left; width: 100%;">
                    <fieldset class="masterform">
                        
                              
                        <div style=" width: 100%; height:40px; overflow-y: scroll;">
                            <table>
                <tr>
                            
                        <td> <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" Visible="false"  CssClass="FormButton"/>
                            <asp:Button ID="btnExportExcel" runat="server" CssClass="FormButton" Visible="false" OnClick="btnExportExcel_Click" Text="Export To Excel" />
                    </td> 
                </tr>
            </table>


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