<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" EnableEventValidation="false" CodeBehind="Spray_Bid_Process.aspx.cs" Inherits="VMT.Spray_Bid_Process" %>
<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>
           Spray Bid Process
        </h1>
    </div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cphMainContentPlaceHolder" runat="server">
    <script type="text/javascript" language="javascript">
        function Validate_Checkbox() {

            var chks = document.getElementsByTagName('input');
            var hasChecked = false;
            for (var i = 0; i < chks.length; i++) {
                if (chks[i].checked) {
                    hasChecked = true;
                    break;
                }
            }
            if (hasChecked == false) {
                alert("Select at least one checkbox");

                return false;
            }

            return true;
        }
    </script>

      <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="bid.aspx">Bid</a> <strong>&#8249;&#8249;</strong>Spray Bid Process-Open</div>
                        <div >
             <fieldset class="masterform">
                <legend>Open New Project for Bid</legend> 
                <div style=" width: 100%; height:300px; ">
                    <table>
                        <tr>
                            <td> Business Unit:
                                <asp:DropDownList ID="ddlBUnit" runat="server" OnSelectedIndexChanged="ddlBUnit_SelectedIndexChanged" AutoPostBack="true" OnDataBound="ddlBUnit_DataBound">
                                </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> Section/WA:
                                <asp:DropDownList ID="ddlWorkArea" runat="server" OnSelectedIndexChanged="ddlWorkArea_SelectedIndexChanged" AutoPostBack="true" OnDataBound="ddlWorkArea_DataBound">
                                </asp:DropDownList>
                            </td>--%>

                             <%--<td> <asp:Button ID="btnGo" runat="server" Text="Go" OnClick="btn_go_Click" Enabled="false" CssClass="FormButton"/></td> --%>
                        </tr>
                    </table>
                    <br />
               <div style=" width: 100%; height: 240px; overflow-y: scroll;" > <br />
                <asp:GridView ID="gdvBidProcess" runat="server" HeaderStyle-CssClass="FixedHeader" BorderColor="#014567" CellPadding="3" 
                     AutoGenerateColumns="False"  emptydatatext="No data in the data source." 
                     OnSorting="gdvBidProcess_Sorting" AllowSorting="True">
                    <AlternatingRowStyle BackColor="#E9EFF2" />
                    <Columns>
                         <asp:TemplateField SortExpression="BUSINESS_UNIT" HeaderStyle-Width="251px" ItemStyle-Width="250px">
                            <HeaderTemplate >
                                <asp:LinkButton ID="LinkButton1"  runat="server" Text="BUSINESS UNIT"  CommandName="Sort" CommandArgument="BUSINESS_UNIT" ForeColor="Black"/>
                            </HeaderTemplate>
                            <ItemTemplate >
                                <%# Eval("BUSINESS_UNIT") %>
                            </ItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField SortExpression="YEAR" HeaderStyle-Width="121px" ItemStyle-Width="120px">
                            <HeaderTemplate>
                                <asp:LinkButton  ID="LinkButton2" runat="server" Text="YEAR"  CommandName="Sort" CommandArgument="YEAR" ForeColor="Black"/>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%# Eval("YEAR") %>
                            </ItemTemplate>

                        </asp:TemplateField>
                        <asp:TemplateField SortExpression="EVENT_CODE"  HeaderStyle-Width="301px" ItemStyle-Width="300px">
                            <HeaderTemplate>                                      
                                <asp:LinkButton  ID="LinkButton3" runat="server" Text="PROJECT/EVENT"  CommandName="Sort" CommandArgument="EVENT_CODE" ForeColor="Black"/>                       
                            </HeaderTemplate >
                            <ItemTemplate>
                                <asp:Label ID="lbl_EVENT_CODE_ID" runat="server" Text='<%# Eval("EVENT_CODE_ID") %>' Visible="false"></asp:Label>
                                <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>
                            <HeaderTemplate>
                                Description                                
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%# Eval("Description") %>
                            </ItemTemplate>
                        </asp:TemplateField>--%>

                       <%-- <asp:TemplateField  SortExpression="WORK_AREA_TEXT" HeaderStyle-Width="151px" ItemStyle-Width="150px">
                            <HeaderTemplate>
                                <asp:LinkButton  ID="LinkButton4" runat="server" Text="SECTION/WA"  CommandName="Sort" CommandArgument="WORK_AREA_TEXT" 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_TEXT") %>'  target="_blank">   <asp:Label ID="Label1" runat="server" Text='<%# Bind("WORK_AREA_TEXT") %>'></asp:Label></a>
                            </ItemTemplate>
                        </asp:TemplateField>--%>

                        <asp:templatefield  HeaderStyle-Width="120px" ItemStyle-Width="120px">
                           
                            <HeaderTemplate>
                                 <asp:checkbox ID="cbSelectAll"  runat="server" AutoPostBack="true" ForeColor="Black" 
                                     OnCheckedChanged="chkboxSelectAll_CheckedChanged" TextAlign="Right"></asp:checkbox>  All 
                                                           
                            </HeaderTemplate>
                            <%-- <HeaderStyle  HorizontalAlign="Right" VerticalAlign="Middle" Wrap="False" Width="40px" />--%>
                            <itemtemplate>
                                <asp:checkbox ID="cbSelect"  runat="server"  AutoPostBack="true"></asp:checkbox>
                            </itemtemplate>
                           
                            <ItemStyle  HorizontalAlign="Left" VerticalAlign="Middle" />
                        </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">
                                <legend>Create Bidding</legend>
                              
                                <div style=" width: 100%; height:40px; overflow-y: scroll;">
                                    <table>
                        <tr>
                            <td> Bid Description:
                                <asp:TextBox ID="txtDesc" runat="server" Enabled="true" ></asp:TextBox>
                            </td>
                             <td> <asp:Button ID="btnSubmitBid" runat="server" Text="Add Bid" OnClick="btnSubmitBid_Click"  OnClientClick="return Validate_Checkbox()" 
                                 enabled="true"  CssClass="FormButton"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                 <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>
