<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Masters/AgentMaster.Master"
    CodeBehind="BlockUnblockUsers.aspx.cs" Inherits="CasheeremitAgent.Account.BlockUnblockUsers" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cpHead" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpLyremit" runat="server">
    <asp:ScriptManager ID="smgr" runat="server">
    </asp:ScriptManager>
    <div id="Div1" runat="server" class="col-md-12">
        <script type="text/javascript">
            function DisplayProgress() {

                $find('<%=ModalPopupExtender2.ClientID %>').show();
                setTimeout('document.images["imgLoad"].src = "../Styles/images/loading.gif"', 10);
            }

        </script>
        <div class="clearfix">
            &nbsp;
        </div>
        <div class="bluHD col-md-12">
            Block/Unblock Agents
        </div>
        <div class="col-md-12 vinobox ">
            <div class="clearfix">
                &nbsp;
            </div>
            <div class="span6 mrg10-T ">
                <div id="dvendet" visible="false" runat="server" class="col-md-6">
                    <div class="row mrgBot10">
                        <div class=" col-md-3">
                            <asp:Label ID="lblAgtid" runat="server" Text="Agent ID"></asp:Label>
                        </div>
                        <div class=" col-md-7">
                            <asp:TextBox ID="txtagentid" CssClass ="Txtbox_demo2" runat="server" MaxLength="50"></asp:TextBox>
                            <asp:RegularExpressionValidator ID="regremID" runat="server" ValidationGroup="View"
                                ControlToValidate="txtagentid" Display="Dynamic" CssClass="errMsg" ErrorMessage="Please enter a valid AgentID"
                                ValidationExpression="^([a-zA-Z0-9]{5,50})$"></asp:RegularExpressionValidator>
                        </div>
                    </div>
                    <div class="row mrgBot10">
                        <asp:Button ID="btnView" runat="server" Text="Search" CssClass ="btnB" OnClick="btnSearch_click"
                            ValidationGroup="View" />
                        <asp:Button ID="btnclear" runat="server" Text="Clear" CssClass ="btnG" OnClick="btnClear_click" />
                    </div>
                </div>
                <div class="clrfx">
                    &nbsp;
                </div>
                <div visible="false" id="dvAgents" runat="server" class="table-responsive m-t-20">
                    <asp:GridView ID="gvAgents" runat="server" CssClass="table table-striped table-bordered tablefieldWidth bgrow"
                        AutoGenerateColumns="False" DataKeyNames="Agent_ID,UserName,First_Name,Last_Name,EmailID,MobileNo,Agent_Status,MultiLoginStatus,Agent_Name"
                        OnRowCommand="gvAgentList_RowCommand" OnPageIndexChanging="gvAgents_PageIndexChanging"
                        OnRowDataBound="gvAgents_RowDataBound" AllowPaging="True" EmptyDataText="No Remitters Found"
                        CellPadding="6" CellSpacing="2" GridLines="None" AlternatingRowStyle-BackColor="#ffffff">
                        <RowStyle CssClass="faq_text_tb2" />
                        <Columns>
                            <asp:BoundField DataField="Agent_ID" HeaderText="Agent ID" />
                            <asp:BoundField DataField="UserName" HeaderText="User Name" />
                            <asp:BoundField DataField="First_Name" HeaderText="First Name" />
                            <asp:BoundField DataField="Last_Name" HeaderText="Last Name" />
                            <asp:BoundField DataField="EmailID" HeaderText="Email ID" ItemStyle-Wrap="true" ItemStyle-CssClass="WordWrap" />
                            <asp:BoundField DataField="MobileNo" HeaderText="Mobile No" />
                            <asp:BoundField DataField="Agent_Status" HeaderText="Agent Status" />
                            <asp:TemplateField ShowHeader="False">
                                <ItemTemplate>
                                    <asp:LinkButton ID="btnBlockUnblock" runat="server" Text="Block/Unblock" CommandName="upd"
                                        OnClientClick="DisplayProgress();" CausesValidation="false" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Login Enabled?">
                                <ItemTemplate>
                                    <asp:LinkButton ID="btnEnbleDisable" runat="server" CommandName="UpdStats"
                                        OnClientClick="DisplayProgress();" CausesValidation="false" Text='<%#Eval("MultiLoginStatus")%>' />
                                     
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </div>
            </div>
            <div id="dvEdit" runat="server" visible="false">
                <div class="row">
                    <div class="form-group col-sm-6">
                        <asp:Label ID="lblAgentid1" runat="server" Text="Agent ID" CssClass="col-md-4 control-label text-left"></asp:Label>
                        <div class="col-md-8">
                            <asp:TextBox ID="txtagentid1" Enabled="false" runat="server" CssClass="form-control"></asp:TextBox>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="form-group col-sm-6">
                        <asp:Label ID="lblusername1" runat="server" Text="User Name" CssClass="col-md-4 control-label text-left"></asp:Label>
                        <div class="col-md-8">
                            <asp:TextBox ID="txtusername1" Enabled="false" runat="server" CssClass="form-control"></asp:TextBox>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="form-group col-sm-6">
                        <asp:Label ID="lblstatus" runat="server" Text="Status" CssClass="col-md-4 control-label text-left"></asp:Label>
                        <div class="col-md-8">
                            <asp:DropDownList ID="ddlStatus" runat="server" CssClass="form-control">
                                <asp:ListItem Value="0" Selected="True" Text="Select"></asp:ListItem>
                                <asp:ListItem Value="BLOCK" Text="InActive"></asp:ListItem>
                                <asp:ListItem Value="UNBLOCK" Text="Active"></asp:ListItem>
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="reqddlStatus" runat="server" ControlToValidate="ddlStatus"
                                InitialValue="Select" ErrorMessage="Please select a status" Display="Dynamic"
                                Font-Size="X-Small" ValidationGroup="Submit"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="form-group col-sm-6">
                        <span class="col-md-4">
                            <asp:Label ID="lblComments" CssClass ="control-label text-left" runat="server" Text="Comments"></asp:Label><span
                                class="text-danger f-s-10">&lowast;</span></span>
                        <div class="col-md-8">
                            <asp:TextBox ID="txtComments" runat="server" CssClass="form-control" MaxLength="50"
                                TextMode="MultiLine"   onkeypress="return textbxMultilineMaxNumber(this,50)" Style="width: 100%; max-height: 80px; min-width: 170px; min-height: 30px;"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="reqCommon" runat="server" ControlToValidate="txtComments"
                                ErrorMessage="Please enter Comments" Display="Dynamic" Font-Size="X-Small" ValidationGroup="Submit"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="regCommon" runat="server" ValidationGroup="Submit"
                                ControlToValidate="txtComments" Display="Dynamic" CssClass="errMsg" ErrorMessage="Please enter a valid Comments"
                                ValidationExpression="^(([a-zA-Z0-9-,_.&]\s?){1,50})$"></asp:RegularExpressionValidator>
                        </div>
                    </div>
                </div>
                <div class="col-md-8 ">
                    <div class="col-md-3">
                        <asp:Button ID="btnSubmit" runat="server" Text="Submit" ValidationGroup="Submit" OnClientClick="DisplayProgress();"
                            OnClick="btnSubmit_click" CssClass="btnB" />
                    </div>
                    <div class="col-md-6">
                        <asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClick="btnCancel_click"
                            CssClass="btnG" />
                    </div>
                </div>
            </div>
            <div id="dvLoginAccss" runat="server" visible="false">
                <div class="row">
                    <div class="form-group col-sm-6">
                        <asp:Label ID="lblAgentid2" runat="server" Text="Agent ID" CssClass="col-md-4 control-label text-left"></asp:Label>
                        <div class="col-md-8">
                            <asp:TextBox ID="txtagentid2" Enabled="false" runat="server" CssClass="form-control"></asp:TextBox>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="form-group col-sm-6">
                        <asp:Label ID="lblusername2" runat="server" Text="User Name" CssClass="col-md-4 control-label text-left"></asp:Label>
                        <div class="col-md-8">
                            <asp:TextBox ID="txtusername2" Enabled="false" runat="server" CssClass="form-control"></asp:TextBox>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="form-group col-sm-6">
                        <asp:Label ID="lblstatus1" runat="server" Text="Login Access Status" CssClass="col-md-4 control-label text-left"></asp:Label>
                        <div class="col-md-8">
                            <asp:DropDownList ID="ddlStatus1" runat="server" CssClass="form-control">
                                <asp:ListItem Value="0" Selected="True" Text="Select"></asp:ListItem>
                                <asp:ListItem Value="Y" Text="Enable"></asp:ListItem>
                                <asp:ListItem Value="N" Text="Disable"></asp:ListItem>
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="reqddlStatus1" runat="server" ControlToValidate="ddlStatus1"
                                InitialValue="Select" ErrorMessage="Please select a status" Display="Dynamic"
                                Font-Size="X-Small" ValidationGroup="Submit"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                </div>              
                <div class="col-md-8 ">
                    <div class="col-md-3">
                        <asp:Button ID="btnsubmit1" runat="server" Text="Submit" ValidationGroup="Submit" OnClientClick="DisplayProgress();"
                            OnClick="btnLoginAccess_Click" CssClass="btnB" />
                    </div>
                    <div class="col-md-6">
                        <asp:Button ID="btnCancel1" runat="server" Text="Cancel" OnClick="btnCancel1_Click"
                            CssClass="btnG" />
                    </div>
                </div>
            </div>
        </div>
        <div id="dvProgressbar">
            <asp:Button runat="server" ID="Button1" Style="display: none" />
            <asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Style="display: none">
                <div class="modal1">
                    <div class="center1">
                        <!-- Start -->
                        <img id="imgLoad" alt="Please wait....." src="../Styles/images/loading.gif" />
                        <!-- End -->
                        <asp:ModalPopupExtender ID="ModalPopupExtender2" runat="server" TargetControlID="Button1"
                            PopupControlID="Panel1" BackgroundCssClass="modalBackground" DropShadow="false" />
                    </div>
                </div>
            </asp:Panel>
        </div>
    </div>
</asp:Content>
