<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="RateAssignment.aspx.cs" Inherits="VMT.RateAssignment" %>
<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>
           Company 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="Administration.aspx">Administration</a> <strong>&#8249;&#8249;</strong> Company 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: 24%">Business Unit</td>
                                            <td style="width: 16%">Work Year</td>
                                            <td style="width: 16%">Company</td>
                                        </tr>
                                        <tr>
                                            <td style="width: 24%">
                                                <asp:DropDownList ID="ddl_Bunit" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddl_Bunit_SelectedIndexChanged">
                                                </asp:DropDownList>
                                            </td>
                                            <td style="width: 16%">
                                                <asp:DropDownList ID="ddl_Year" runat="server" Width="130px" AutoPostBack="true" OnSelectedIndexChanged="ddl_Year_SelectedIndexChanged">
                                                </asp:DropDownList>
                                            </td>
                                            <td style="width: 16%">
                                                <asp:DropDownList ID="ddl_Company" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddl_Company_SelectedIndexChanged" Width="130px"  >
                                                </asp:DropDownList>
                                                <asp:HiddenField ID="hdn_role" runat="server" />
                                            </td>
                                        </tr>
                                    </table>
                                    
                                </div>
                            </fieldset></div>
                        <div style="text-align:left; width: 100%;">
                            <fieldset class="masterform">
                                <legend>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: 23%">TRIM TYPE</td>
                                           <td style="width: 22%">UOM</td>
                                           <td style="width: 22%">RATE AMOUNT($)</td>
                                           <td id="rowAdd" runat="server" style="width: 10%">
                                               <asp:ImageButton ID="btnshowhide" runat="server" Height="25px" ImageUrl="resource_gallery/graphics/plus.png"  Width="25px" OnClick="btnshowhide_Click" />
                                            </td>
                                        </tr>
                                        
                                    </table>
                                     <asp:Panel runat="server" ID="CreateNew">
                                        <table cellpadding="2" cellspacing="1" border="1" class="auto-style3">
                                            <tr>
                                                <td style="width: 23%">
                                                    <asp:DropDownList ID="ddl_RateTypes" runat="server" AutoPostBack="True" OnDataBound="ddl_RateTypes_DataBound" OnSelectedIndexChanged="ddl_RateTypes_SelectedIndexChanged" >
                                                    </asp:DropDownList>
                                                </td>
                                                <td style="width: 22%">
                                                    <asp:Label ID="lbl_UOM" runat="server" Text=""></asp:Label>
                                                </td>
                                                <td style="width: 22%">
                                                    <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" ShowHeader="False" OnRowCreated="gdv_Rate_Company_RowCreated" OnRowDeleting="gdv_Rate_Company_RowDeleting" >
                                        <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="28%" />
                                            </asp:BoundField>
                                            <asp:BoundField DataField="RATE_TYPE_AMOUNT" HeaderText="RATE AMOUNT($)" >
                                                <ItemStyle Width="29%" HorizontalAlign="Right" />
                                            </asp:BoundField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:Label ID="lbl_RATE_TYPE_ID" runat="server" Text='<%# Bind("RATE_TYPE_ID") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <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>
                                        </Columns>
                                        <HeaderStyle BackColor="#98C8DE" Font-Bold="True" />
                                        <SelectedRowStyle BackColor="#FFE98F" />
                                    </asp:GridView>


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