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

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .auto-style2 {
            width: 70%;
        }
        .auto-style3 {
            text-align: center;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphJavaScriptContentPlaceHolder" runat="server">
      <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"/>
      <link rel="stylesheet" href="/resources/demos/style.css"/>
      <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
      <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

     <script type="text/javascript">
         $(document).ready(function () {
             pageLoad();
             Sys.WebForms.PageRequestManager.getInstance().add_endRequest(pageLoad);
         });
         function pageLoad() {
             $("#<%= txtDueDate.ClientID %>").datepicker({
                dateFormat: 'mm-dd-yy',
                changeMonth: true,
                changeYear: true,
                gotoCurrent: true,
                yearRange: '-0:+1',
                constrainInput: false
            });
        }
    </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphPageTitleContentPlaceHolder" runat="server">
    <div id="CssPageTitle">
        <h1>
           Project/Event Inspection
        </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> Project/Event Inspection</div>
              <div style="text-align:left; width: 100%;">
             <fieldset class="masterform">
                <legend>Inspection OPEN/CLOSE</legend> 
                <div style=" width: 100%; height:35px; ">


		            <table class="auto-style2">
                        <tr>
                            <td class="auto-style3">
                                <asp:RadioButton ID="rbt_open" runat="server" GroupName="inspect" Checked="True" OnCheckedChanged="rbt_open_CheckedChanged" AutoPostBack="True" /> Open For Inspection
                            </td>
                            <td class="auto-style3">
                                <asp:RadioButton ID="rbt_close" runat="server" GroupName="inspect" AutoPostBack="True" OnCheckedChanged="rbt_close_CheckedChanged" /> Inspection Close
                            </td>
                        </tr>
                    </table>


		</div>
       	       </fieldset>
</div>
              <div style="text-align:left; width: 100%;">
             <fieldset class="masterform">
                <legend>Open for Contractor</legend> 
                <div style=" width: 100%; height:35px; ">
                    <table>
                        <tr>
                            <td> Business Unit:
                                <asp:DropDownList ID="ddlBUnit" runat="server"  AutoPostBack="true" OnDataBound="ddlBUnit_DataBound" OnSelectedIndexChanged="ddlBUnit_SelectedIndexChanged">
                                </asp:DropDownList>
                            </td>
                                                        <td> Work Year:
                                <asp:DropDownList ID="ddlYear" runat="server"  AutoPostBack="true" OnDataBound="ddlYear_DataBound" OnSelectedIndexChanged="ddlYear_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> <asp:Button ID="btnGo" runat="server" Text="Go" OnClick="btnGo_Click"  CssClass="FormButton"/></td> --%>
                        </tr>
                    </table>
                    <br />
              
                 

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

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

                     <div style=" width: 100%; height: 240px; overflow-y: scroll;" > <br />
		            <asp:GridView ID="gdvOpenContractor" runat="server" AllowSorting="True" AutoGenerateColumns="false" BorderColor="#014567" CellPadding="3" emptydatatext="No data in the data source." HeaderStyle-CssClass="FixedHeader">
                        <AlternatingRowStyle BackColor="#E9EFF2" />
                        <Columns>
                            <asp:TemplateField HeaderStyle-Width="231px" ItemStyle-Width="230px" SortExpression="EVENT_CODE">
                                <HeaderTemplate>
                                    <asp:LinkButton ID="LinkButton12" runat="server" CommandArgument="EVENT_CODE" CommandName="Sort" ForeColor="Black" Text="PROJECT/EVENT" />
                                </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>
                                <HeaderStyle Width="231px" />
                                <ItemStyle Width="230px" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderStyle-Width="101px" ItemStyle-Width="100px" SortExpression="WORK_AREA">
                                <HeaderTemplate>
                                    <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument="WORK_AREA" CommandName="Sort" ForeColor="Black" Text="SECTION/WA" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="lbl_WORK_AREA_ID" runat="server" Text='<%# Eval("WORK_AREA_ID") %>' Visible="false"></asp:Label>
                                    <%--<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="Label1" runat="server" Text='<%# Bind("WORK_AREA") %>'></asp:Label>
                                    </a>
                                </ItemTemplate>
                                <HeaderStyle Width="101px" />
                                <ItemStyle Width="100px" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderStyle-Width="141px" ItemStyle-Width="140px" SortExpression="COMPANY">
                                <HeaderTemplate>
                                    <asp:LinkButton ID="LinkButton2" runat="server" CommandArgument="COMPANY" CommandName="Sort" ForeColor="Black" Text="COMPANY" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="lbl_COMPANY_ID" runat="server" Text='<%# Eval("COMPANY_ID") %>' Visible="false"></asp:Label>
                                    <%# Eval("COMPANY") %>
                                </ItemTemplate>
                                <HeaderStyle Width="141px" />
                                <ItemStyle Width="140px" />
                            </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 HeaderStyle-Width="161px"  ItemStyle-Width="160px">
                                <HeaderTemplate>
                                 <asp:CheckBox ID="cbSelectAll" runat="server" AutoPostBack="true"   ForeColor="Black" TextAlign="Left" OnCheckedChanged="cbSelectAll_CheckedChanged" />
                                   <asp:Label ID="lbl_insp" runat="server" Text='' ></asp:Label>
                                   
                                </HeaderTemplate>
                                <%--  <HeaderStyle  HorizontalAlign="Right" VerticalAlign="Middle" Wrap="False" Width="40px" />--%>
                                <itemtemplate>
                                    <asp:CheckBox ID="cbSelect" runat="server" AutoPostBack="true" Checked='<%#Convert.ToBoolean(Eval("checkd") ) %>' Enabled='<%# Convert.ToBoolean(Eval("open")) %>' />
                                </itemtemplate>
                                <HeaderStyle Width="161px" />
                                <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" />
                            </asp:templatefield>
                            <asp:TemplateField HeaderStyle-Width="141px" ItemStyle-Width="140px" SortExpression="STATUS">
                                <HeaderTemplate>
                                    <asp:LinkButton ID="LinkButton3" runat="server" CommandArgument="STATUS" CommandName="Sort" ForeColor="Black" Text="STATUS" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <%# Eval("STATUS") %>
                                </ItemTemplate>
                                <HeaderStyle Width="141px" />
                                <ItemStyle Width="140px" />
                            </asp:TemplateField>
                           <asp:TemplateField HeaderStyle-Width="100px" ItemStyle-Width="100px" SortExpression="inspection_due_date">
                                <HeaderTemplate >
                                    <asp:LinkButton ID="LinkButton4" runat="server" CommandArgument="inspection_due_date" CommandName="Sort" ForeColor="Black" TextAlign="Left" Text="INS DUE DATE" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                   <asp:label id="DateAddedLabel" runat="server" text='<%# (String.IsNullOrEmpty(Eval("inspection_due_date").ToString())) ? "No Date" : Eval("inspection_due_date", "{0:MM/dd/yyyy}") %>'></asp:label>
                                </ItemTemplate>
                                <HeaderStyle Width="100px" />
                                <ItemStyle Width="100px" />
                            </asp:TemplateField>
                        </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; overflow-y: scroll;">
                            <table>
                <tr>
                        <td id="rowDueDate" runat="server" visible="false">Due Date :&nbsp;<asp:TextBox ID="txtDueDate" runat="server"></asp:TextBox>
                            <asp:HiddenField ID="hdn_role" runat="server" />
                        </td>  
                        <td> <asp:Button ID="btnSave" runat="server" Text="Save"  Visible="false"  CssClass="FormButton" OnClick="btnSave_Click"/>
                            <asp:Button ID="btnExportExcel" runat="server" CssClass="FormButton" Visible="false" Text="Export To Excel" OnClick="btnExportExcel_Click" />
                    </td> 
                </tr>
            </table>


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

