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

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        .HeaderFreeze
        {
            height: 40px;
            top: 80px;
        }
    </style>

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

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

    <script type="text/javascript">
        // code for risk dropdown 
        function toggleSubmit(obj) {

            count = 0
            while (document.getElementById("d" + count)) {
                document.getElementById("d" + count).style.display = "none"
                count++
            }
            document.getElementById("d" + obj.selectedIndex).style.display = "block"

        }
        function toggleSubmit1(obj) {

            count = 0
            while (document.getElementById("c" + count)) {
                document.getElementById("c" + count).style.display = "none"
                count++
            }
            document.getElementById("c" + obj.selectedIndex).style.display = "block"

        }
        function toggleSubmit2(obj) {

            count = 0
            while (document.getElementById("b" + count)) {
                document.getElementById("b" + count).style.display = "none"
                count++
            }
            document.getElementById("b" + obj.selectedIndex).style.display = "block"

        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div id="contentmain">
        <div id="content">
            <div id="detailform">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="27%">
                            &nbsp;
                        </td>
                        <td width="14%">
                            Select User Type
                        </td>
                        <td width="1%">
                            <strong>:</strong>
                        </td>
                        <td width="58%">
                            <asp:DropDownList ID="ddlManageType" runat="server" AutoPostBack="true" Width="225px"
                                OnSelectedIndexChanged="ddlManageType_SelectedIndexChanged">
                                <asp:ListItem>Select</asp:ListItem>
                                <asp:ListItem>Manage Distributor</asp:ListItem>
                                <asp:ListItem>Manage Agent</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" style="text-align: right; padding: 10px 0px;">
                            <div id="c0" style="display: ">
                            </div>
                            <div id="c1" runat="server">
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td width="10%">
                                            &nbsp;
                                        </td>
                                        <td width="11%">
                                            Select WL/MD From
                                        </td>
                                        <td width="1%">
                                            <strong>:</strong>
                                        </td>
                                        <td width="20%">
                                            <asp:DropDownList ID="ddlMdWlFrm" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlMdWlFrm_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </td>
                                        <td width="11%">
                                            Select WL/MD To
                                        </td>
                                        <td width="1%">
                                            <strong>:</strong>
                                        </td>
                                        <td width="23%">
                                            <asp:DropDownList ID="ddlMdWlTo" runat="server">
                                            </asp:DropDownList>
                                        </td>
                                        <td width="23%">
                                            <asp:Button ID="btnSubmit" runat="server" Text="Submit" CssClass="button active"
                                                OnClick="btnSubmit_Click" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="8" style="padding: 20px 20px;">
                                            <asp:GridView ID="gvManageDistributors" runat="server" AutoGenerateColumns="false"
                                                BorderColor="#CCCCCC" BackColor="White" Font-Bold="False" Font-Italic="False"
                                                Font-Overline="False" Font-Strikeout="False" Font-Underline="False" Width="1200px"
                                                BorderStyle="None" BorderWidth="1px" CellPadding="3" ShowHeader="true" CssClass="HeaderFreeze"
                                                AllowPaging="true" PageSize="200" ShowFooter="true" OnPageIndexChanging="gvManageDistributors_PageIndexChanging">
                                                <PagerSettings Mode="NextPreviousFirstLast" NextPageText="Next" PreviousPageText="Previous" />
                                                <RowStyle HorizontalAlign="Center" ForeColor="#000066" />
                                                <Columns>
                                                    <asp:TemplateField HeaderText="Select">
                                                        <ItemTemplate>
                                                            <asp:CheckBox ID="chkbox" runat="server" />
                                                            <%#Container.DisplayIndex+1%>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:BoundField HeaderText="Distributor Name" DataField="FIRSTNAME" />
                                                    <asp:TemplateField HeaderText="Distributor Id">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lbl_username" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.USERNAME") %>'>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:BoundField HeaderText="MD/WL ID" DataField="UPPERLEVEL" />
                                                    <asp:BoundField HeaderText="E-mail Id" DataField="EMAILID" />
                                                    <asp:BoundField HeaderText="Mobile No." DataField="MOBILENO" />
                                                    <asp:BoundField HeaderText="Reg.Date" DataField="DATEOFJOINING" />
                                                    <asp:BoundField HeaderText="Balance" DataField="NETAMOUNT" />
                                                </Columns>
                                                <FooterStyle BackColor="White" ForeColor="#000066" 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>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="8" style="padding: 10px 0px;">
                                            <div id="d0" style="display: none">
                                            </div>
                                            <div id="d2" style="display: none">
                                                &nbsp;</div>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <div id="c2" runat="server">
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td width="10%">
                                            &nbsp;
                                        </td>
                                        <td width="13%">
                                            Select Distributor From
                                        </td>
                                        <td width="1%">
                                            <strong>:</strong>
                                        </td>
                                        <td width="18%">
                                            <asp:DropDownList ID="ddlDistributorFrm" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlDistributorFrm_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </td>
                                        <td width="11%">
                                            Select Distributor To
                                        </td>
                                        <td width="1%">
                                            <strong>:</strong>
                                        </td>
                                        <td width="23%">
                                            <asp:DropDownList ID="ddlDistributorTo" runat="server">
                                            </asp:DropDownList>
                                        </td>
                                        <td width="23%">
                                            <asp:Button ID="btnSubmitAgent" runat="server" Text="Submit" 
                                                CssClass="button active" onclick="btnSubmitAgent_Click" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="8" style="padding: 20px 20px;">
                                            <asp:GridView ID="gvAgent" runat="server" AutoGenerateColumns="false" BorderColor="#CCCCCC"
                                                BackColor="White" Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                Font-Strikeout="False" Font-Underline="False" Width="1200px" BorderStyle="None"
                                                BorderWidth="1px" CellPadding="3" ShowHeader="true" CssClass="HeaderFreeze" AllowPaging="true"
                                                PageSize="200" ShowFooter="true" OnPageIndexChanging="gvManageDistributors_PageIndexChanging">
                                                <PagerSettings Mode="NextPreviousFirstLast" NextPageText="Next" PreviousPageText="Previous" />
                                                <RowStyle HorizontalAlign="Center" ForeColor="#000066" />
                                                <Columns>
                                                    <asp:TemplateField HeaderText="Select">
                                                        <ItemTemplate>
                                                            <asp:CheckBox ID="chkbox" runat="server" />
                                                            <%#Container.DisplayIndex+1%>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:BoundField HeaderText="Agent Name" DataField="FIRSTNAME" />
                                                    <asp:TemplateField HeaderText="Agent Id">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lbl_username" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.USERNAME") %>'>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:BoundField HeaderText="Distributor ID" DataField="UPPERLEVEL" />
                                                    <asp:BoundField HeaderText="E-mail Id" DataField="EMAILID" />
                                                    <asp:BoundField HeaderText="Mobile No." DataField="MOBILENO" />
                                                    <asp:BoundField HeaderText="Reg.Date" DataField="DATEOFJOINING" />
                                                    <asp:BoundField HeaderText="Balance" DataField="NETAMOUNT" />
                                                </Columns>
                                                <FooterStyle BackColor="White" ForeColor="#000066" 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>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="6">
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</asp:Content>
