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

<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 Project Rate Assignment
        </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="Assignments.aspx">Assignment</a> <strong>&#8249;&#8249;</strong>Spray Project Rate Assignment</div>
 <div style="text-align:left; width: 100%;">
                            <fieldset class="masterform">
                                <legend>Select Company</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%">Company</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>
                                            <td style="width: 25%">
                                                <asp:DropDownList ID="ddl_Company" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddl_Company_SelectedIndexChanged" OnDataBound="ddl_Company_DataBound" >
                                                </asp:DropDownList>
                                            </td>
                                        </tr>
                                    </table>
                                    
                                </div>
                            </fieldset></div>
                        <div style="text-align:left; width: 100%;">
                            <fieldset class="masterform">
                                <legend>Project Company Rate List</legend>
                              
                                <div style=" width: 100%; overflow-y: scroll;">
                                    <table cellpadding="4" cellspacing="1" border="1" class="auto-style3">
                                        <tr style="background-color:#98C8DE;">
                                            <td style="width: 30%">TRIM TYPE</td>
                                           <td style="width: 30%">UOM</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:DropDownList ID="ddl_RateTypes" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddl_RateTypes_SelectedIndexChanged" OnDataBound="ddl_RateTypes_DataBound" >
                                                </asp:DropDownList>
                                            </td>
                                           <td style="width: 30%">
                                               <asp:Label ID="lbl_UOM" runat="server" Text=""></asp:Label>
                                            </td>
                                           <td style="width: 30%">
                                               <asp:TextBox ID="txt_Rateamount" 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>

                                </div>
                                     <div style=" width: 100%; height:200px; overflow-y: scroll;">
                                    <asp:GridView ID="gdv_Rate_Company" runat="server" BorderColor="#014567" CellPadding="3"  Width="100%"
                                        AutoGenerateColumns="False" OnRowCreated="gdv_WA_Rate_RowCreated" OnRowDeleting="gdv_Rate_Company_RowDeleting" ShowHeader="False" >
                                        <AlternatingRowStyle BackColor="#E9EFF2" />
                                        <Columns>
                                            <asp:BoundField DataField="RATE_TYPE_NAME" HeaderText="RATE TYPE" >
                                            <ItemStyle Width="30%" />
                                            </asp:BoundField>
                                            <asp:BoundField DataField="UOM" HeaderText="UOM" >
                                            <ItemStyle Width="30%" />
                                            </asp:BoundField>
                                            <asp:BoundField DataField="rate_type_amount" HeaderText="RATE AMOUNT" >
                                            <ItemStyle Width="30%" />
                                            </asp:BoundField>
                                            <asp:TemplateField ShowHeader="False" HeaderText="Delete">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete" ><img src="resource_gallery/graphics/icon_delete.png" /></asp:LinkButton>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("RATE_TYPE_ID") %>'></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="lbl_RATE_TYPE_ID" runat="server" Text='<%# Bind("RATE_TYPE_ID") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("business_unit_id") %>'></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="lbl_BUSINESS_UNIT_ID" runat="server" Text='<%# Bind("business_unit_id") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("company_id") %>'></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="lbl_COMPANY_ID" runat="server" Text='<%# Bind("company_id") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("RATE_YEAR_ID") %>'></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="lbl_RATE_YEAR_ID" runat="server" Text='<%# Bind("RATE_YEAR_ID") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                           <asp:TemplateField>
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("EVENT_CODE_ID") %>'></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="lbl_EVENT_CODE_ID" runat="server" Text='<%# Bind("EVENT_CODE_ID") %>'></asp:Label>
                                                </ItemTemplate>
                                            </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">
                                <legend>Navigate to</legend>
                                <div style=" width: 100%; height:40px; ">
                                    
                                    <table class="auto-style2">
                                        <tr>
                                           <td style="width: 40%" rowspan="2">
                                                 <asp:LinkButton ID="btn_WA_COMP" runat="server"  Text="<< Assign Project/Section/Work to a Vendor " OnClick="btn_WA_COMP_Click" />
                                       
                                               <%-- <asp:Button ID="btn_WA_COMP" runat="server" CssClass="FormButton" Text="<< Project Company Assignment" OnClick="btn_WA_COMP_Click" />--%>
                                                </td>
                                            <td style="width: 10%"><%--To Assign Rates for all WorkArea associated with selected Project and Year, Click Assign.--%></td>
                                           
                                            

                                            <td style="width: 20%" rowspan="2">
                                                 <asp:Button ID="btn_assign" Visible="false" runat="server" CssClass="FormButton" OnClick="btn_create_Click" Text="Assign" />
                                                <asp:Button ID="btn_expExcel" runat="server" CssClass="FormButton" Text="Export to Excel" OnClick="btn_expExcel_Click" />
                                            </td>
                                             <td style="width: 30%" rowspan="2">
                                                 <asp:LinkButton ID="btn_warateComp" runat="server" Text="WorkArea Rate Assignment >>" OnClick="btn_warateComp_Click" Visible="false" />
                                               <%--  <asp:Button ID="btn_warateComp" runat="server" Text="WorkArea Rate Assignment >>" OnClick="btn_warateComp_Click" />--%>
                                            </td>
                                        </tr>
                                        
                                    </table>
                                    
                                </div>
                            </fieldset></div>


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


