<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="EC_WA.aspx.cs" Inherits="VMT.EC_WA" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
     <style type="text/css">
        .auto-style2 {
            width: 100%;
            padding: 3px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphJavaScriptContentPlaceHolder" runat="server">
     <link rel="stylesheet" href="http://localhost:56693/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() {
            $("#<%= txtTrimDate.ClientID %>").datepicker({
                dateFormat: 'mm-dd-yy',
                changeMonth: true,
                changeYear: true,
                gotoCurrent: true,
                yearRange: '-0:+0',
                constrainInput: false
            });
        }
    </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphPageTitleContentPlaceHolder" runat="server">
    <div id="CssPageTitle">
        <h1>
            Event Code Maintenance
        </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 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="Administration.aspx">Administration</a> <strong>&#8249;&#8249;</strong> Trim Event Code Maintenance</div>
             <div style="text-align:left; width: 100%;">
                    <fieldset class="masterform">
                        <div style=" width: 100%; height:30px; ">                                    
                            <table class="auto-style2">
                                <tr>
                                    <td style="width: 150px">Businesss Unit</td>
                                    <td>
                                        <asp:DropDownList ID="ddlBunit" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlBunit_SelectedIndexChanged">
                                        </asp:DropDownList>
                                    </td>
                                    <%--<td>Year</td>
                                    <td><asp:DropDownList ID="ddlYear" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlYear_SelectedIndexChanged">
                                        </asp:DropDownList>
                                    </td>--%>
                                </tr>
                            </table>
                        </div>
                    </fieldset>
                </div>
            <div id="wrapper" class="clear">
                <div id="left" style="width:49%;">
                    <fieldset>
                        <legend>Event Code</legend>
                        <div style=" width: 100%; height:250px; ">
                            <table class="auto-style2" cellpadding="2">
                                <tr>
                                   <td>&nbsp;</td>
                                   <td>
                                       <asp:RadioButtonList ID="rblEventCode" runat="server" RepeatDirection="Horizontal" Width="150px" AutoPostBack="true" OnSelectedIndexChanged="rblEventCode_SelectedIndexChanged">
                                           <asp:ListItem Text=" Add New" Value="0"></asp:ListItem>
                                           <asp:ListItem Text=" Existing" Value="1" Selected="True"></asp:ListItem>
                                       </asp:RadioButtonList>
                                   </td>
                               </tr>
                                <tr>
                                    <td style="width: 50%">Event Code ID</td>
                                    <td style="width: 50%">
                                        <asp:DropDownList ID="ddlEventCode" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlEventCode_SelectedIndexChanged"></asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 50%;"> Event Code </td>
                                    <td style="width: 50%">
                                        <asp:TextBox ID="txtEventCode" runat="server" AutoPostBack="true" OnTextChanged="txtEventCode_TextChanged"></asp:TextBox>
                                    </td>
                                </tr>
                                 <tr>
                                    <td style="width: 50%">Event Description</td>
                                    <td style="width: 50%">
                                        <asp:TextBox ID="txtEventDescription" runat="server"></asp:TextBox>
                                    </td>
                                </tr>          
                                  <tr>
                                    <td style="width: 50%">Project Trim Date</td>
                                    <td style="width: 50%">
                                        <asp:TextBox ID="txtTrimDate" runat="server" Enabled="false" ReadOnly="true"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 50%">District</td>
                                    <td style="width: 50%">
                                        <asp:DropDownList ID="ddlDistrict" runat="server"></asp:DropDownList>
                                    </td>
                                </tr>      
                                <tr>
                                    <td style="width: 50%">&nbsp;</td>
                                    <td style="width: 50%">&nbsp;</td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <div style=" width: 100%; height:100px; overflow-y: scroll;"><br />
                                        <asp:GridView ID="gdv_WA_Company" runat="server" AutoGenerateColumns="False" BorderColor="#014567" CellPadding="3" HeaderStyle-CssClass="FixedHeader">
                                            <AlternatingRowStyle BackColor="#E9EFF2" />
                                            <Columns>
                                                <asp:TemplateField HeaderStyle-Width="84px" HeaderText="Event Code" ItemStyle-Width="84px">
                                                    <ItemTemplate>
                                                        <%--<a href='LocateWA_Map.aspx?EVENT_CODE_ID=<%# Eval("EVENT_CODE_ID") %>&amp;nm=<%# Eval("EVENT_CODE") %>' target="_blank">--%>
                                                        <a href='MapView_PS.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 HeaderStyle-Width="81px" HeaderText="Work Area" ItemStyle-Width="81px">
                                                    <ItemTemplate>
                                                        <%--<a href='LocateWA_Map.aspx?WORK_AREA_ID=<%# Eval("WORK_AREA_ID") %>&amp;nm=<%# Eval("WORK_AREA") %>' target="_blank">--%>
                                                        <a href='MapView_PS.aspx?EVENT_CODE_ID=<%# Eval("EVENT_CODE_ID") %>&WORK_AREA_ID=<%# Eval("WORK_AREA_ID") %>'  target="_blank">
                                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("WORK_AREA") %>'></asp:Label>
                                                        </a>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:BoundField HeaderStyle-Width="131px" HeaderText="Description" ItemStyle-Width="130px" />
                                            </Columns>
                                            <HeaderStyle BackColor="#98C8DE" Font-Bold="True" />
                                            <SelectedRowStyle BackColor="#FFE98F" />
                                        </asp:GridView>

                                        </div>
                                    </td>
                                </tr>
                            </table>  
                        </div>
                    </fieldset>
                </div>
         
                 <div id="right" style="width:49%;">
                     <fieldset>
                        <legend>Workarea</legend> 
                        <div style=" width: 100%; height:250px; ">
                           <table class="auto-style2" cellpadding="2">
                               <tr>
                                   <td>&nbsp;</td>
                                   <td>
                                       <asp:RadioButtonList ID="rblWorkArea" runat="server" RepeatDirection="Horizontal" Width="150px" AutoPostBack="true" OnSelectedIndexChanged="rblWorkArea_SelectedIndexChanged">
                                           <asp:ListItem Text=" Add New" Value="0"></asp:ListItem>
                                           <asp:ListItem Text=" Existing" Value="1" Selected="True"></asp:ListItem>
                                       </asp:RadioButtonList>
                                   </td>
                               </tr>
                               <asp:Panel ID="pnlWAEventCode" runat="server">
                                    <tr>
                                        <td style="width: 50%">Event Code</td>
                                        <td style="width: 50%">
                                            <asp:DropDownList ID="ddlWAEventCode" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlWAEventCode_SelectedIndexChanged"></asp:DropDownList>
                                        </td>
                                    </tr>
                                </asp:Panel>
                                <tr>
                                    <td style="width: 50%">Workarea</td>
                                    <td style="width: 50%">
                                        <asp:DropDownList ID="ddlWorkArea" runat="server" Width="120px" AutoPostBack="true" OnSelectedIndexChanged="ddlWorkArea_SelectedIndexChanged"></asp:DropDownList>&nbsp;<asp:CheckBox ID="chkSplit" runat="server" Text="Split" Visible="false" AutoPostBack="true" OnCheckedChanged="chkSplit_CheckedChanged"/>
                                    </td>
                                </tr>
                               <%--<tr>
                                   <td>&nbsp;</td>
                                   <td style="text-align:center;"><b>Trim</b></td>
                                   <td style="text-align:center;"><b>Spray</b></td>
                               </tr>--%>
                                <tr>
                                    <td style="width: 50%">Cycle</td>
                                    <td style="width: 50%">
                                        <asp:DropDownList ID="ddlCycle" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlCycle_SelectedIndexChanged"></asp:DropDownList>
                                    </td>
                                    <%--<td><asp:DropDownList ID="ddlSprayCycle" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlSprayCycle_SelectedIndexChanged"></asp:DropDownList></td>--%>
                                </tr>
                               <tr>
                                    <td>Cycle Year</td>
                                    <td><asp:DropDownList ID="ddlCycleYr" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlCycleYr_SelectedIndexChanged"></asp:DropDownList></td>
                                    <%--<td><asp:DropDownList ID="ddlSprayCycleYr" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlSprayCycleYr_SelectedIndexChanged"></asp:DropDownList></td>--%>
                                </tr>
                               <tr>
                                    <td>Work Year</td>
                                    <td><asp:DropDownList ID="ddlTrimYr" runat="server"></asp:DropDownList></td>
                                    <%--<td><asp:DropDownList ID="ddlSprayTrimYr" runat="server"></asp:DropDownList></td>--%>
                                </tr>
                                <tr>
                                    <td>FTYT</td>
                                    <td><asp:TextBox ID="txtFTYT" runat="server"></asp:TextBox></td>
                                    <%--<td><asp:TextBox ID="txtSprayFTYT" runat="server"></asp:TextBox></td>--%>
                                </tr>
                               <tr>
                                    <td>Section Code</td>
                                    <td><asp:TextBox ID="txtSectionCode" runat="server" MaxLength="2"></asp:TextBox></td>
                                    <td>&nbsp;</td>
                               </tr>
                               <tr>
                                   <td>Section Description</td>
                                   <td><asp:TextBox ID="txtWADescription" runat="server"></asp:TextBox></td>
                                   <%--<td>&nbsp;</td>--%>
                               </tr>
                               <asp:Panel ID="pnlSectionCode" runat="server" Visible="false" style="font-weight: 700">
                                   <tr>
                                        <td><b>New Section Code</b></td>
                                        <td><asp:TextBox ID="txtNewSectionCode" runat="server" MaxLength="2"></asp:TextBox></td>
                                        <%--<td>&nbsp;</td>--%>
                                   </tr>
                                   <tr>
                                       <td><b>New Work Area Description</b></td>
                                       <td><asp:TextBox ID="txtNewWADescription" runat="server"></asp:TextBox></td>
                                       <%--<td>&nbsp;</td>--%>
                                   </tr>
                               </asp:Panel>
                           </table>  
                        </div>
                   </fieldset>
                </div>
            </div>
          <div style="text-align:left; width: 100%; position:absolute;">
                <fieldset class="masterform">
                    <div style=" width: 100%; height:36px; ">                                    
                        <table class="auto-style2">
                            <tr><td  style="width: 20%">Comment</td>
                                <td style="width: 50%">
                                    <asp:TextBox ID="txtComment" runat="server" Width="354px" TextMode="MultiLine"></asp:TextBox>
                                </td>
                                <td><asp:Button ID="btnSubmit" runat="server" CssClass="FormButton" Text="Submit" OnClick="btnSubmit_Click"/>&nbsp;&nbsp;</td>                                    
                            </tr>
                        </table>
                    </div>
                </fieldset>
            </div>
    </ContentTemplate>
     </asp:UpdatePanel>
</asp:Content>
