<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage/AdminMasterPage.master" AutoEventWireup="true" CodeFile="WLCommission.aspx.cs" 
Inherits="Admin_WLCommission" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script src="script/ddlevelsmenu.js" type="text/javascript"></script>

    <script src="script/func.js" type="text/javascript"></script>    

    <script src="../Javascript/scriptvalidation.js" type="text/javascript"></script>
    
    <script language="javascript" type="text/javascript">
        function fixedlength(textboxID, keyEvent, maxlength) {
            //validation for digits upto 'maxlength' defined by caller function
            if (textboxID.value.length > maxlength) {
                textboxID.value = textboxID.value.substr(0, maxlength);
            }
            else if (textboxID.value.length < maxlength || textboxID.value.length == maxlength) {
                textboxID.value = textboxID.value.replace(/[^\d]+/g, '');
                return true;
            }
            else
                return false;
        }

        function numericFilter(txb) {
            txb.value = txb.value.replace(/[^\0-9]/ig, "");
        }

        function SelectAll(CheckBox) {
            TotalChkBx = parseInt('<%= this.GVWlRechargeComm.Rows.Count %>');
            var TargetBaseControl = document.getElementById('<%= this.GVWlRechargeComm.ClientID %>');
            var TargetChildControl = "chkSelect";
            var Inputs = TargetBaseControl.getElementsByTagName("input");
            for (var iCount = 0; iCount < Inputs.length; ++iCount) {
                if (Inputs[iCount].type == 'checkbox' && Inputs[iCount].id.indexOf(TargetChildControl, 0) >= 0)
                    Inputs[iCount].checked = CheckBox.checked;
            }
        }
 </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div id="contentmain">
        <div id="content">
            <div id="detailform">
                <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">                
                   <tr>
                        <td width="30%">
                            &nbsp;
                        </td>
                        <td width="14%" style="text-align:right">
                            Select User
                        </td>
                        <td width="4%" style="text-align:center">
                            <strong>:</strong>
                        </td>
                        <td width="54%">
                            <asp:DropDownList ID="ddl_selectUserId" runat="server" Width="225px" 
                                onselectedindexchanged="ddl_selectUserId_SelectedIndexChanged">
                            </asp:DropDownList>
                                <asp:RequiredFieldValidator ID="rfv_User" runat="server" ErrorMessage="Please Select User" ControlToValidate="ddl_selectUserId"
                                 InitialValue="select" ></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td width="30%">
                            &nbsp;
                        </td>
                        <td width="14%" style="text-align:right">
                            Select Service
                        </td>
                        <td width="4%" style="text-align:center">
                            <strong>:</strong>
                        </td>
                        <td width="54%">
                            <asp:DropDownList ID="DropDownList3" runat="server" Width="225px" OnSelectedIndexChanged="DropDownList3_SelectedIndexChanged"
                                AutoPostBack="true">
                                <asp:ListItem Value="0">Select Type</asp:ListItem>
                                <asp:ListItem Value="1">Recharge</asp:ListItem>
                                <asp:ListItem Value="2">Bill Payment</asp:ListItem>
                                <asp:ListItem Value="4">Money Transfer</asp:ListItem>
                                <asp:ListItem Value="ELECTRICITY">Electricity Bill Payment</asp:ListItem>
                                <asp:ListItem Value="3">Other</asp:ListItem>
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Please Select Service" ControlToValidate="DropDownList3"
                                 InitialValue="Select Type" ></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr><td colspan="4" style="height:25">&nbsp;</td></tr>
                    
                    <tr>
                        <td colspan="4" style="text-align:center;" >
                             <div style="margin:0 0 0 230px">
                                   <asp:GridView ID="GVWlRechargeComm" runat="server" AutoGenerateColumns="False" BorderColor="#CCCCCC"
                                    BackColor="White" Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                    Font-Strikeout="False" Font-Underline="False" Width="850px" BorderStyle="None"
                                    BorderWidth="1px" CellPadding="3" ShowHeader="true" CssClass="HeaderFreeze" 
                                    ShowFooter="true" DataKeyNames="MobileDthOperatorID" >
                                    <RowStyle HorizontalAlign="Center" ForeColor="#000066" />
                                <Columns>
                                    <asp:TemplateField HeaderText="Select">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="chkSelect" runat="server" />
                                        </ItemTemplate>
                                        <HeaderTemplate>
                                            <asp:CheckBox ID="chkSelectAll" runat="server" Text="Select All" onclick="SelectAll(this);" />
                                        </HeaderTemplate>
                                    </asp:TemplateField> 
                                    <asp:TemplateField HeaderText="Operator" ItemStyle-Width="230">
                                        <ItemTemplate>
                                            <asp:Label ID="lblOperator" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.OperatorName") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>                                    
                                    <asp:BoundField HeaderText="Service" DataField="OperatorType" ItemStyle-Width="230"/>                                    
                                    <asp:TemplateField HeaderText="Margin(in %)" ItemStyle-Width="230">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtCommission" Width="95px" runat="server" MaxLength="4" Text='<%# DataBinder.Eval(Container, "DataItem.WlCommInPercentag") %>' onKeyUp="numericFilter(this);"></asp:TextBox>%
                                        </ItemTemplate>
                                    </asp:TemplateField>                                                                       
                                </Columns>
                                <FooterStyle BackColor="#DBE4E8" HorizontalAlign="Center" VerticalAlign="Middle" />
                                <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Center" />
                                <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" HorizontalAlign="Center" />
                                <HeaderStyle BackColor="#DBE4E8" Font-Bold="True" ForeColor="Black" HorizontalAlign="Center" />
                                <EditRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <AlternatingRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:GridView>                                                        
                             </div>   
                                 
                                <asp:GridView ID="GVWlBillPayComm" runat="server" AutoGenerateColumns="False" BorderColor="#CCCCCC"
                                    BackColor="White" Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                    Font-Strikeout="False" Font-Underline="False" Width="1330px" BorderStyle="None"
                                    BorderWidth="1px" CellPadding="3" ShowHeader="true" CssClass="HeaderFreeze" 
                                    ShowFooter="true" DataKeyNames="MobileDthOperatorID">
                                    <RowStyle HorizontalAlign="Center" ForeColor="#000066" />
                                <Columns>
                                    <asp:TemplateField>
                                        <ItemTemplate >
                                            <asp:CheckBox ID="chkbox" runat="server" />
                                            <%#Container.DataItemIndex+1 %>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Operator" ItemStyle-Width="220">
                                        <ItemTemplate>
                                            <asp:Label ID="lblOperator" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.OperatorName") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>                                    
                                    <asp:BoundField HeaderText="Service" DataField="OperatorType" ItemStyle-Width="220"/>                                    
                                    <asp:TemplateField HeaderText="Margin(in %)" ItemStyle-Width="220">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtWlCommInPercentag" Width="95px" runat="server" MaxLength="4" Text='<%# DataBinder.Eval(Container, "DataItem.WlCommInPercentag") %>' onKeyUp="numericFilter(this);"></asp:TextBox>%
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Charges (in %)" ItemStyle-Width="220">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtWlSerCharInPercentag" Width="95px" runat="server" MaxLength="4" Text='<%# DataBinder.Eval(Container, "DataItem.WlSerCharInPercentag") %>' onKeyUp="numericFilter(this);"></asp:TextBox>%
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Charges (in Rs.)" ItemStyle-Width="220">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtWlSerChaInRS" Width="95px" runat="server" MaxLength="4" Text='<%# DataBinder.Eval(Container, "DataItem.WlSerChaInRS") %>' onKeyUp="numericFilter(this);"></asp:TextBox>Rs
                                        </ItemTemplate>
                                    </asp:TemplateField>                                                                       
                                </Columns>
                                <FooterStyle BackColor="#DBE4E8" HorizontalAlign="Left" VerticalAlign="Middle" />
                                <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                                <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" HorizontalAlign="Center" />
                                <HeaderStyle BackColor="#DBE4E8" Font-Bold="True" ForeColor="Black" HorizontalAlign="Left" />
                                <EditRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <AlternatingRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:GridView>
                            
                            <div style="margin:0 0 0 220px">
                            <asp:GridView ID="GVOtherServices" runat="server" AutoGenerateColumns="False" BorderColor="#CCCCCC"
                                    BackColor="White" Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                    Font-Strikeout="False" Font-Underline="False" Width="950px" BorderStyle="None"
                                    BorderWidth="1px" CellPadding="3" ShowHeader="true" CssClass="HeaderFreeze" 
                                    ShowFooter="true" DataKeyNames="MobileDthOperatorID">
                                    <RowStyle HorizontalAlign="Center" ForeColor="#000066" />
                                <Columns>
                                    <asp:TemplateField>
                                        <ItemTemplate >
                                            <asp:CheckBox ID="chkbox" runat="server" />
                                            <%#Container.DataItemIndex+1 %>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Operator" ItemStyle-Width="200">
                                        <ItemTemplate>
                                            <asp:Label ID="lblOperator" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.OperatorName") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>                                    
                                    <asp:BoundField HeaderText="Service" DataField="OperatorType" ItemStyle-Width="200"/>                                    
                                    <asp:TemplateField HeaderText="Margin(in %)" ItemStyle-Width="200">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtWlCommInPercentag" Width="95px" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.WlCommInPercentag") %>' onKeyUp="numericFilter(this);"></asp:TextBox>%
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Margin(in Rs.)" ItemStyle-Width="200">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtWlSerChaInRS" Width="95px" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.WlSerChaInRS") %>' onKeyUp="numericFilter(this);"></asp:TextBox>Rs.
                                        </ItemTemplate>
                                    </asp:TemplateField>                                                                                                          
                                </Columns>
                                <FooterStyle BackColor="#DBE4E8" HorizontalAlign="Left" VerticalAlign="Middle" />
                                <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                                <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" HorizontalAlign="Center" />
                                <HeaderStyle BackColor="#DBE4E8" Font-Bold="True" ForeColor="Black" HorizontalAlign="Left" />
                                <EditRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <AlternatingRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:GridView>  </div>
                        </td>
                    </tr>
                    <tr><td colspan="4" style="height:30px"></td></tr>
                    <tr><td colspan="4" style="text-align:center"><asp:Button ID="btnSubmit" 
                            runat="server" Text="Submit" CssClass="button active" 
                            onclick="btnSubmit_Click" /></td></tr>
                </table>
            </div>
        </div>
    </div>

</asp:Content>

