<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="SprayPayment.aspx.cs" Inherits="VMT.SprayPayment" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="resource_gallery/js/ShowHide.js"></script>
    <style type="text/css">
        .auto-style2 {
            width: 100%;
            padding: 3px;
        }
        .auto-style3 {
            width: 100%;
            border: 1px solid #014567;
            
        }
       </style>
</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 Payment Status
        </h1>
    </div>
    <div id="SubPageTitle">
        <!-- OPTIONAL SUB PAGE TITLE -->
     
    </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="CurrentYTD.aspx">Current</a> <strong>&#8249;&#8249;</strong> Payment Status</div>
 <div style="text-align:left; width: 100%;">
                            <fieldset class="masterform">
                                <legend>Select Event Code</legend>
                                <div style=" width: 100%; height:60px; ">
                                    
                                    <table class="auto-style2">
                                        <tr>
                                            <td style="width: 25%">Business Unit</td>
                                            <td style="width: 25%">Work Year</td>
                                         
                                             <td style="width: 25%">Project/Event</td>
                                               <td style="width: 25%" rowspan="2">
                                                   <asp:Button ID="btnGo" runat="server" CssClass="FormButton" OnClick="btnGo_Click" Text="Go" Visible="False" />
                                            </td>
                                            <td style="width: 25%" rowspan="2">
                                              
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 25%">
                                                <asp:DropDownList ID="ddl_Bunit" runat="server" AutoPostBack="True" OnDataBound="ddl_Bunit_DataBound" OnSelectedIndexChanged="ddl_Bunit_SelectedIndexChanged" >
                                                </asp:DropDownList>
                                            </td>
                                            <td style="width: 25%">
                                                <asp:DropDownList ID="ddl_Year" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddl_Year_SelectedIndexChanged" OnDataBound="ddl_Year_DataBound" >
                                                </asp:DropDownList>
                                            </td>
                                            
                                           <td style="width: 25%">
                                                <asp:DropDownList ID="ddlEventCode" runat="server" AutoPostBack="true" OnDataBound="ddlEventCode_DataBound" OnSelectedIndexChanged="ddlEventCode_SelectedIndexChanged">  
                                                </asp:DropDownList>
                                            </td>
                                        </tr>
                                    </table>
                                    
                                </div>
                            </fieldset></div>
                        <div style="text-align:left; width: 100%;">
                            <fieldset class="masterform">
                                <legend>Project Payment Head</legend>
                              
                                 <div style=" width: 100%; height:160px; overflow-y: scroll;"><br />
                                    <asp:GridView ID="gdv_Payheader" runat="server"  HeaderStyle-CssClass="FixedHeader"   BorderColor="#014567" CellPadding="3" 
                                        AutoGenerateColumns="False" OnSelectedIndexChanged="gdv_Payheader_SelectedIndexChanged" OnRowCreated="gdv_Payheader_RowCreated" OnRowDataBound="gdv_Payheader_RowDataBound" >
                                        <AlternatingRowStyle BackColor="#E9EFF2" />
                                        <Columns>
                                           
                                            <asp:TemplateField HeaderText="Pay" ShowHeader="False"  HeaderStyle-Width="31px" ItemStyle-Width="30px">
                                                <ItemTemplate>
                                                    <asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="False" CommandName="Select" ImageUrl="resource_gallery/graphics/payment.png" Text="" />
                                                </ItemTemplate>
                                                <ItemStyle HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                           <%-- <asp:TemplateField HeaderText="Section/WA"  HeaderStyle-Width="81px" ItemStyle-Width="80px">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("WORK_AREA") %>'></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                      <a href='MapView_PS.aspx?EVENT_CODE_ID=<%# Eval("EVENT_CODE_ID") %>&WORK_AREA_ID=<%# Eval("WORK_AREA_ID") %>'  target="_blank">   <asp:Label ID="Label8" runat="server" Text='<%# Bind("WORK_AREA") %>'></asp:Label></a>
                                                </ItemTemplate>
                                            </asp:TemplateField>--%>
                                            <asp:TemplateField HeaderText="COMPANY"  HeaderStyle-Width="111px" ItemStyle-Width="110px">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("COMPANY_NAME") %>'></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("COMPANY_NAME") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="AUDIT-DATE"  HeaderStyle-Width="101px" ItemStyle-Width="100px">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("AUDIT_DATE") %>'></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("AUDIT_DATE") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="PREAPPROVAL.DATE"  HeaderStyle-Width="141px" ItemStyle-Width="140px">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("PRE_APPROVAL_DATE") %>'></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("PRE_APPROVAL_DATE") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="TOTAL LENGTH"  HeaderStyle-Width="111px" ItemStyle-Width="110px">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("TOTAL_LENGTH") %>'></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="Label5" runat="server" Text='<%# Bind("TOTAL_LENGTH") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="TOTAL AREA"  HeaderStyle-Width="101px" ItemStyle-Width="100px">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("TOTAL_AREA") %>'></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="Label6" runat="server" Text='<%# Bind("TOTAL_AREA") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="TOTAL ACTUAL"  HeaderStyle-Width="100px" ItemStyle-Width="100px">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("TOTAL_ACTUAL") %>'></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="Label7" runat="server" Text='<%# Bind("TOTAL_ACTUAL") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="PAYMENT AMT"  HeaderStyle-Width="100px" ItemStyle-Width="100px">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("PAYMENT_AMOUNT") %>'></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="Label8" runat="server" Text='<%# Bind("PAYMENT_AMOUNT") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:BoundField DataField="payment_id" HeaderText="payment_id" >
                                    
                                            </asp:BoundField>
                                            
                                        </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">
                                <legend>Payment Details</legend>
                              
                                <div style=" width: 100%; height:160px; overflow-y: scroll;">
                                     <table cellpadding="4" cellspacing="1" border="1" class="auto-style3">
                                        <tr style="background-color:#98C8DE;">
                                            <td style="width: 30%">DATE</td>
                                           <td style="width: 30%">STATUS</td>
                                           <td style="width: 30%">AMOUNT</td>
                                           <td id="rowAdd" runat="server" style="width: 10%">
                                               <asp:ImageButton ID="btnshowhide" runat="server" Height="25px" ImageUrl="resource_gallery/graphics/plus.png" OnClick="btnshowhide_Click" Width="25px" />
                                            </td>
                                        </tr>
                                        
                                    </table>
                                     <asp:Panel runat="server" ID="CreateNew">
                                                <table cellpadding="2" cellspacing="1" border="1" class="auto-style3">
                                        <tr>
                                            <td style="width: 30%">
                                                <asp:HiddenField ID="hdn_PAYMENT_ID" runat="server" />
                                            </td>
                                           <td style="width: 30%">
                                               <asp:DropDownList ID="ddl_PAYMENT_STATUS" runat="server">
                                                   <asp:ListItem>PAID</asp:ListItem>
                                                   <asp:ListItem>PENDING</asp:ListItem>
                                                   <asp:ListItem>ACCRUAL</asp:ListItem>
                                               </asp:DropDownList>
                                            </td>
                                           <td style="width: 30%">
                                               <asp:TextBox ID="txt_PAYMENT_AMOUNT" runat="server"></asp:TextBox>
                                            </td>
                                           <td id="rowAddBtn" runat="server" style="width: 10%">
                                               <asp:Button ID="btn_addRates" runat="server" CssClass="FormButton" Text="Add" OnClick="btn_addRates_Click" />
                                            </td>
                                        </tr>
                                                    </table>
                                           </asp:Panel>
                                    

<asp:GridView ID="gdv_Paydetail" runat="server" AutoGenerateColumns="False" BorderColor="#014567" CellPadding="3" Width="100%" OnRowDeleting="gdv_Paydetail_RowDeleting" OnRowCreated="gdv_Paydetail_RowCreated"  ShowHeader="False">
                                                   <AlternatingRowStyle BackColor="#E9EFF2" />
                                                   <Columns>
                                                       <%--<asp:BoundField DataField="WORK_AREA" HeaderText="WORK AREA" />--%>
                                                       <asp:BoundField DataField="TRANS_TIMESTAMP" HeaderText="DATE" >
                                                       <ItemStyle Width="30%" />
                                                       </asp:BoundField>
                                                       <asp:BoundField DataField="PAYMENT_STATUS" HeaderText="STATUS" >
                                                       <ItemStyle Width="30%" />
                                                       </asp:BoundField>
                                                       <asp:BoundField DataField="PAYMENT_AMOUNT" HeaderText="AMOUNT" >
                                                       
                                                       <ItemStyle Width="30%" />
                                                       </asp:BoundField>
                                                        <asp:TemplateField ShowHeader="False" HeaderText="Delete">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete" >
                                                        <%--<asp:Image ID="img1" runat="server" ImageUrl="~/resource_gallery/graphics/icon_delete.png" />--%>
                                                        <img id="imgDelete" runat="server" src="resource_gallery/graphics/icon_delete.png" /></asp:LinkButton>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                                       

                                                        <asp:TemplateField>
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("OBJECTID") %>'></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="lbl_OBJECTID" runat="server" Text='<%# Bind("OBJECTID") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                           <asp:TemplateField>
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("PAYMENT_ID") %>'></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="lbl_PAYMENT_ID" runat="server" Text='<%# Bind("PAYMENT_ID") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>

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


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


                         </table>


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