<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/FiniqAppMasterPage.Master"
    CodeBehind="FinIQ_RMSetup.aspx.vb" Inherits="FinIQWebApp.FinIQ_RMSetup" Title="Sales Group Setup" %>
   <%--Changed title from RM Group Setup to Sales Group Setup by Apurva K|| 20 May 2022|| Assigned by DJ--%>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

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

    </script>
    	    <%--Start Added by shubham k on 11-Feb-21 for UBP UI Standard--%>
        <link href="../FinIQJS/FreezeGrid.css" type="text/css" rel="stylesheet">
 <script src="../FinIQJS/FreezeGrid.js" type="text/javascript"></script> 
    <%--End Added by shubham k on 11-Feb-21 for UBP UI Standard--%>
    <script type="text/javascript"> 

              
    //    function chkDelGroupValidation(obj) {

   //         var ddl1 = document.getElementById("<%=ddlGroupName.ClientID%>");
   //         if (ddl1.options.length <= 0) {
   //             confirmationDialog(obj, 'Confirmation', '\n Group name should not be blank. Please check the inputs.')
   //             return false;
   //         }

   //         else
   //             return confirmationDialog(obj, 'Confirmation', '\n Are you sure, you want to delete RM group Mapping ?');
   //     }
    </script>
    <script type="text/javascript">
        String.Format = function () {
            var s = arguments[0];
            for (var i = 0; i < arguments.length - 1; i++) {
                var reg = new RegExp("\\{" + i + "\\}", "gm");
                s = s.replace(reg, arguments[i + 1]);
            }
            return s;
        }
        var dialogConfirmed = false;
        function ViewDialogDuplicate(obj, title, dialogText) {
           if ($("#pageName").html() != null) {
                // title = "View - " + $("#pageName").html();
            }
            // alert("hi " + title + "" + obj);

            if (!dialogConfirmed) {
              //  $('html').append(String.Format("<div id='dialog' title='{0}'><p style='float:left;'><span class='ui-icon ui-icon-alert' style='float:left; margin:0 5px 20px 0;'></span>{1}</p></div>", title, dialogText));
                $('html').append(String.Format("<div id='dialog' title='{0}'><div class='infoConfirmationBox' style='float:left; height:22px !important; width:22px !important; margin: 13px 15px 20px 10px;'></div><p> " + dialogText + " </p></div>", title));

                $('#dialog').dialog
                        ({
                            height: 180,
                            width: 350,
                            modal: true,
                            resizable: false,
                            draggable: true,
                            close: function (event, ui) { $('html').find('#dialog').remove(); },
                            buttons:
                            {
                                'Yes': function () {
                                    if ($('#ctl00_MainContent_hdnbtnName').val() == "Delete Mapping") {
                                        $("#ctl00_MainContent_btnConfirmation").click();
                                        $(this).dialog('close');
                                    }
                                    else if ($('#ctl00_MainContent_hdnbtnName').val() == "Delete Group") {
                                        $("#ctl00_MainContent_btnCnfrmDeleteGp").click();
                                        $(this).dialog('close');
                                    }

                                },
                                'No': function () {
                                    $(this).dialog('close');
                                    $('html').find("#dialog").remove();
                                    return false;
                                }
                            }
                        });
            }

            return dialogConfirmed;

            $(".ui-widget-overlay").height($("body").height());

        }


        function EnterKeySearchByRMGroup(evt) {
            var code = (evt.which) ? evt.which : evt.keyCode;

            if (code == 13 || code == 9) {
                document.getElementById('<%=btnFindRMGroup.ClientID%>').click();
            }
        }

        function EnterKeySearchByRM_Name(evt) {
            var code = (evt.which) ? evt.which : evt.keyCode;

            if (code == 13 || code == 9) {
                document.getElementById('<%=btn_find.ClientID%>').click();
            }
        }
       //<Changes done by Nitin N on 16-Jun-2021 : Added records per page,total records and search functionality changes suggested by Pari Sir>
        function EnterKeySearchByMappedRM(evt) {
            var code = (evt.which) ? evt.which : evt.keyCode;

            if (code == 13 || code == 9) {
                document.getElementById('<%=btnMappedRMFind.ClientID%>').click();
            }
        }

        function EnterKeyEvent(evt) {
            var code = (evt.which) ? evt.which : evt.keyCode;
            // Changes done by Nitin N on 1-Apr-2020 : Mail Ref : RM setup postbacks on each tab, fix asap and integrate : suggested by Pari Sir.>
            if (code == 13) {
                document.getElementById('<%=btnPageCnt.ClientID%>').click();
            }
        }

        function EnterKeyEventRMlist(evt) {
            var code = (evt.which) ? evt.which : evt.keyCode;
            // Changes done by Nitin N on 1-Apr-2020 : Mail Ref : RM setup postbacks on each tab, fix asap and integrate : suggested by Pari Sir.>
            if (code == 13) {
                document.getElementById('<%=btnRmListCnt.ClientID%>').click();
            }
        }

        function EnterKeyEventRMGroup(evt) {
            var code = (evt.which) ? evt.which : evt.keyCode;
            // Changes done by Nitin N on 1-Apr-2020 : Mail Ref : RM setup postbacks on each tab, fix asap and integrate : suggested by Pari Sir.>
            if (code == 13) {
                document.getElementById('<%=btnRMGroupRecordsPerPage.ClientID%>').click();
            }
        }

        function isNumberKey(evt) {
            var charCode = (evt.which) ? evt.which : evt.keyCode;
            if (charCode > 31 && (charCode < 48 || charCode > 57))
                return false;
            return true;
        }
        //</Changes done by Nitin N on 16-Jun-2021 : Added records per page,total records and search functionality changes suggested by Pari Sir>

    </script>

    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    </asp:ScriptManagerProxy>
    <style>
        #ctl00_MainContent_dgRMGroup td
        {
            padding: 10px !important;
        }

        #ctl00_MainContent_gridview_RM_List
        {
            padding: 10px !important;
        }

        .padright
        {
            padding-right: 0px !important;
            padding-left: 12px !important;
        }
        .auto-style1 {
            height: 28px;
        }

        /*Start Added by shubham k on 11-Feb-2021 for UBP*/
        .btn_padding {
            padding-right: 10px !important;
            padding-top: 5px !important;
        }
        /*End Added by shubham k on 11-Feb-2021 for UBP*/
        /*<Changes done by Nitin N on 16-Jun-2021 : Added records per page,total records and search functionality changes suggested by Pari Sir>*/
        .closeme {
         background-color: Transparent;
         color: #000;
         font: normal 14px/18px Verdana, Helvetica, sans-serif;
         width: 20px;
         height: 20px;
         border: solid 0px #ccc !important; 
       }

    </style>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">

        <ContentTemplate>
            <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="0">
                <ProgressTemplate>
                    <div class="divLoading">
                        <img alt="Loading" src="../App_Resources/loading.gif" /><span class="lbl">Loading... 
                        </span>
                    </div>
                </ProgressTemplate>
            </asp:UpdateProgress>
            <table id="Table1">
                <%-- <tr>
                    <td nowrap class="background_gray ">
                        RM Group Mapping
                    </td>
                </tr>--%>
                <tr>
                    <td nowrap>
                        <asp:Label ID="lblError" runat="server" CssClass="lblerror"></asp:Label>
                        <asp:Label ID="lblInfo" runat="server" CssClass="lblinfo"></asp:Label>
                         <!-- Jira Number :- ANZDCIUPIN-83 Added by Shubham K on 26-Jun-2020 For ANZ. added lblSuccess--->
                        <asp:Label ID="lblSuccess" runat="server" CssClass="lblSuccess"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td style="vertical-align: top;">
                        <table id="tblGroupDefinition" border="0" cellpadding="2" cellspacing="2" runat="server"
                            class="tbl ">
                            <tr>
                                <td style="vertical-align: top;">
                                    <asp:Label ID="lblEntity" runat="server" Text="Home Entity" Visible="false" CssClass ="lbl"></asp:Label>
                                </td>
                                <td>
                                    <asp:Label ID="lblEntityID" runat="server" CssClass ="lbl" Visible="false" ></asp:Label>
                                </td>
                                <td colspan="3"></td>
                            </tr>
                            <tr>
                                <td class="auto-style1">
                                    <asp:Label ID="lblEntityName" runat="server" Text="<%$ Resources:LocalizedText, Entity %>" CssClass="lbl"></asp:Label>
                                </td>
                                <td class="auto-style1">
                                    <asp:DropDownList ID="lstEntityName" runat="server" AutoPostBack="True" CssClass="ddl" 
                                        Width="200px">
                                    </asp:DropDownList>
                                </td>
                                <td colspan="3" class="auto-style1"></td>
                            </tr>
                            <tr>
                                <td class="lblBlotterPaddingRight">
                                    <asp:Label ID="lblGroupName" runat="server" Text="Group Name"></asp:Label>
                                </td>
                                <td>
                                    
                                    <asp:DropDownList ID="ddlGroupName" runat="server" Width="200px" CssClass="ddl" AutoPostBack="true"
                                        ToolTip="Select Sales Group">
                                    </asp:DropDownList>
                                    <asp:TextBox ID="txtGroupName" runat="server" CssClass="txt" Visible="false" Width="200px" MaxLength="50"></asp:TextBox>
                                      
                                    <asp:CheckBox ID="chkAll" CssClass="lbl" runat="server" Text="All Sales Group(s)" AutoPostBack="true"
                                                    Checked="false" ToolTip="All Sales Groups" />

                                    <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" FilterType="Numbers, LowercaseLetters, UppercaseLetters,Custom" ValidChars=" " TargetControlID="txtGroupName" />
                                </td>

                                <td>
                                    <table>
                                        <tr>
                                            <td style="padding-left: 10px;">
                                               
                                                 
                                                <asp:Button ID="btnFind" runat="server" CssClass="btn" Text="Find Sales Group" ToolTip="Find existing Sales Group" Width="95px" />
                                               

                                            </td>
                                             
                                        </tr>
                                    </table>
                                </td>


                            </tr>
                            <tr>
                                <td>
                                     
                                    <asp:Label ID="lblRMName" runat="server" Visible ="false"  CssClass="lbl">Sales Name</asp:Label>
                                </td>
                                <td>
                                   <asp:TextBox ID="txt_RMName" runat="server" ReadOnly="True" Width="234px" CssClass="txt"
                                                    Height="21px" Visible ="false" ></asp:TextBox>	<%--   uncommented By Prajakta for ANZ 4.7 upgrade--%>
                                    <asp:ListBox ID="lstRMName" CssClass="lst" runat="server" Visible ="false" Width="200px" ></asp:ListBox>
                                </td>
                                <td></td>
                                <td style="width: 174px;"></td>
                                <td>
                                     
                                    <asp:Button ID="btnList" runat="server" Text="Sales List" Visible ="false" CssClass="btn" Width="95px"
                                        ToolTip="View unmapped Sales(s)" />
                                    <%--    <asp:Panel ID="pnlRMName" runat="server" CssClass="Filter " Style="position: absolute;
                                                    top: 207px; left: 471px; width: 380px; height: 338px;" Visible="False" ScrollBars="Both">--%>
                                                 
                                </td>

                            </tr>


                            <tr>
                                <td></td>
                                <td colspan="4">
                                    <table>
                                        <tr>
                                            <td colspan="2" class="btn_padding"><%--Added by shubham k on 11-Feb-2021 for UBP--%>
                                                
                                                <asp:Button ID="btnCancel" runat="server" CssClass="btn" Text="Cancel" Width="95px"
                                                    ToolTip="Cancel" />

                                             
                                             <asp:Button ID="btnSave" runat="server" CssClass="btn" Text="Save" Visible="false"
                                                    Width="92px" ToolTip="Save Sales group" />

                                            </td>
                                            <td class="btn_padding"><%--Added by shubham k on 11-Feb-2021 for UBP--%>
                                               
                                                <asp:Button ID="btnMapRM" runat="server" CssClass="btn" Text="Map Sales" Width="95px"
                                                    ToolTip="Map Sales with selected Sales group" />
                                            </td>
                                            <td class="btn_padding"><%--Added by shubham k on 11-Feb-2021 for UBP--%>
                                                 
                                                <asp:Button ID="btnView" runat="server" CssClass="btn" Text="Mapped Sales" Width="95px" ToolTip="View mapped Sales(s) for selected SalesGroup" />                                           
                                            </td>
                                            <td>
                                                 
                                                <asp:Button ID="btnDeleteMapCustomer" runat="server" CssClass="btn" Text="Delete Mapping" Visible="false"
                                                    Width="95px" ToolTip="Delete Sales from selected Sales group" />
                                            </td>
                                            <td class="btn_padding"><%--Added by shubham k on 11-Feb-2021 for UBP--%>
                                                <!-- Jira Number :- ANZDCIUPIN-83 Added by Shubham K on 22-Jun-2020 For ANZ. added margin-left -4px--->
                                                 
                                                <asp:Button ID="btnDeleteGroup" runat="server" CssClass="btn" Text="Delete Group"
                                                    Width="95px" ToolTip="Delete selected Sales group" style="margin-left: -4px !important;"/>


                                            </td>
                                            <td class="btn_padding"><%--Added by shubham k on 11-Feb-2021 for UBP--%>
                                                 
                                                           <asp:Button ID="btnNewGroup" runat="server" CssClass="btn" Text="Add Sales group" Width="95px"
                                                    ToolTip="Add new Sales Group" />
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>

                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <%-- Jira Number :- ANZDCIUPIN-83 Added by Shubham K on 26-Jun-2020 For ANZ. Removed width="87.6%"---%>
                        <asp:Panel ID="pnlRMGroup" runat="server" Visible="false " CssClass="filter"
                            Style="width: 87%; padding: 5px; height: auto;"
                            ScrollBars="Auto">
                            <table style="width:100% !important;">
                                <tr>
                                    <td class="btn_padding"><%--Added by shubham k on 11-Feb-21 for UBP--%>
                                         
                                        <asp:Label ID="Label1" Style="margin-left:4px !important" runat="server" CssClass="lbl" Text="Sales Group"></asp:Label>
                                         <asp:Label ID="lblRMGrpTotalRecords" runat="server" Style ="margin-left :20px;" CssClass="lbl">Total Record(s):</asp:Label>
                                        <asp:Label ID="lblRMGroupTotalRecords" runat="server" CssClass="lbl" Width ="55"></asp:Label>
                                        <asp:Label ID="lblRMGroupRecordsPerPage" runat="server" Style ="margin-left :20px;" CssClass="lbl">Record(s) Per Page:</asp:Label>&nbsp;
                                         <asp:Button ID="btnRMGroupRecordsPerPage" runat="server" Text="" OnClick="txtRMGroupRecordsPerPage_TextChanged" Style="display: none;" />
                                        <asp:TextBox ID="txtRMGroupRecordsPerPage" runat="server" MaxLength="2" Style="width: 30px; text-align: center;" CssClass="txt" onkeydown="EnterKeyEventRMGroup(event)" onkeypress="return isNumberKey(event)" onpaste="return false" oncut="return false"></asp:TextBox>
                                   
                                    </td>
                                    <td style="float: right;">
                                        <!-- Jira Number :- ANZDCIUPIN-83 Added by Shubham K on 26-Jun-2020 For ANZ. Removed width="18"--->
                                        <asp:Button ID="btnCloseRMgroup" runat="server" CssClass="closeme" Text="X"  
                                            ToolTip="close" />
                                    </td>
                                </tr>
                                <tr>
                                    <td style="height: 4px;" colspan="2"></td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <table>
                                            <tr>
                                                <td class="btn_padding"><%--Added by shubham k on 11-Feb-2021 for UBP--%>
                                                   
                                                    <asp:Label ID="lblRMGroup" runat="server" Text="Sales Group"></asp:Label>
                                                </td>
                                                <td class="btn_padding"><%--Added by shubham k on 11-Feb-2021 for UBP--%>
                                                    <asp:TextBox ID="txtRMGroup" runat="server" onkeydown="EnterKeySearchByRMGroup(event)" CssClass="txt " Width="158px"></asp:TextBox>
                                                </td>
                                                <td class="btn_padding"><%--Added by shubham k on 11-Feb-2021 for UBP--%>
                                                    <asp:Button ID="btnFindRMGroup" runat="server" CssClass="btn" Text="Find" Width="62px"
                                                        ToolTip="Find Sales Group" />
                                                </td>
                                                <td class="btn_padding"><%--Added by shubham k on 11-Feb-2021 for UBP--%>
                                                    <asp:Button ID="btnAdd" runat="server" CssClass="btn" Text="Apply" Width="62px" ToolTip="Add selected Sales Group(s)" />
                                                </td>
                                            </tr>
                                        </table>

                                    </td>
                                </tr>
                                <tr>
                                    <td style="height: 4px;" colspan="2"></td>
                                </tr>
                                <tr>
                                    <td style="white-space: nowrap;" colspan="2">
                                        <asp:Label ID="lblErrorRMGroup" runat="server" CssClass="lblinfo_Panel"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">

                                        <table >

                                            <tr>
                                                <td>
                                                    <asp:DataGrid ID="dgRMGroup" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                                                        BorderStyle="None" CssClass="Grid frozenGrid" PageSize="10"> <%--Added by shubham k on 11-Feb-2021 for UBP--%>
                                                        <HeaderStyle CssClass="GridHeader" />
                                                        <ItemStyle CssClass="GridItem" Wrap="False" />
                                                        <PagerStyle CssClass="GridPager" Mode="NumericPages" />
                                                        <Columns>
                                                            <asp:TemplateColumn>
                                                                <ItemStyle HorizontalAlign="Center" />
                                                                <HeaderStyle HorizontalAlign="Center" />
                                                                <%--<HeaderTemplate> Commented by Dhanashri 15-feb-2013 as no need to hv all chkbox on this panel.
                           <asp:CheckBox ID="chkAllItems" runat="server" Text ="All" onclick="SelectAll(this)" />
                         </HeaderTemplate>--%>
                                                                <ItemTemplate>
                                                                    <asp:CheckBox ID="chkSelectedRMGroup" runat="server" />
                                                                </ItemTemplate>
                                                            </asp:TemplateColumn>
                                                            <asp:BoundColumn HeaderText="Sr No">
                                                                <HeaderStyle Wrap="False" HorizontalAlign="Center"></HeaderStyle>
                                                                <%-- Jira Number :- ANZDCIUPIN-83 Added by Shubham K on 26-Jun-2020 For ANZ. Changed width="110px"---%>
                                                                <ItemStyle Width="50px"></ItemStyle>
                                                            </asp:BoundColumn>
                                                            <asp:BoundColumn DataField="RM_Group_Key" HeaderText="Sales Group Key">
                                                                <HeaderStyle Wrap="False" HorizontalAlign="Center"></HeaderStyle>
                                                                <ItemStyle Width="110px"></ItemStyle>
                                                            </asp:BoundColumn>
                                                             
                                                            <asp:BoundColumn DataField="RM_Group_Name" HeaderText="Sales Group Name">
                                                                <HeaderStyle Wrap="False" HorizontalAlign="Center"></HeaderStyle>
                                                                 <%-- Jira Number :- ANZDCIUPIN-83 Added by Shubham K on 26-Jun-2020 For ANZ. Changed width="435px"---%>
                                                                <ItemStyle Width="250px" Wrap="true"></ItemStyle>
                                                            </asp:BoundColumn>
                                                        </Columns>
                                                    </asp:DataGrid>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                            </table>
                        </asp:Panel>

                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Panel ID="pnlRMName" runat="server" Visible="false " CssClass="filter"
                            style="overflow:auto;width:87%;padding:5px;height:auto;" ScrollBars="Auto">
                            <%--top: 238px; left: 411px;--%>
                            <table class="tbl">
                                <tr>
                                    <td>
                                        <%--Added by shubham k on 11-Feb-21 for UBP--%>
                                         
                                        <asp:Label ID="Label3" Style="margin-left: 2px;" runat="server" Text="Sales List"></asp:Label>
                                          <asp:Label ID="lblTotalRMListRecords" runat="server" Style ="margin-left :20px;" CssClass="lbl">Total Record(s):</asp:Label>
                                        <asp:Label ID="lblRMListRecords" runat="server" width="56" CssClass ="lbl"></asp:Label>
                                        <asp:Label ID="lblTotalRecordsPerRecords" runat="server" Style ="margin-left :20px;" CssClass="lbl">Record(s) Per Page:</asp:Label>&nbsp;
                                         <asp:Button ID="btnRmListCnt" runat="server" Text="" OnClick="txtRMListTotalRecordsPerPage_TextChanged" Style="display: none;" />
                                        <asp:TextBox ID="txtRMListTotalRecordsPerPage" runat="server" MaxLength="2" Style="width: 30px; text-align: center;" CssClass="txt" onkeydown="EnterKeyEventRMlist(event)" onkeypress="return isNumberKey(event)" onpaste="return false" oncut="return false"></asp:TextBox>
                                    </td>
                                    <td style="float: right;">
                                        <asp:Button ID="btnRmlist" runat="server" CssClass="closeme" Text="X"  
                                            ToolTip="close" />
                                    </td>
                                </tr>
                                <tr>
                                    <td style="height: 4px;" colspan="2"></td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <table style="border-collapse: collapse; border-spacing: 2px;">
                                            <tr>
                                                <td class="btn_padding"><%--Added by shubham k on 11-Feb-21 for UBP--%>
                                                     
                                                    <asp:Label ID="lbl_rm" runat="server" Text="Sales Name" CssClass="lbl"></asp:Label>
                                                </td>
                                                <td class="btn_padding"><%--Added by shubham k on 11-Feb-21 for UBP--%>
                                                    <asp:TextBox ID="txtRM_Name" runat="server" CssClass="txt" onkeydown="EnterKeySearchByRM_Name(event)" ></asp:TextBox>
                                                </td>
                                                <td class="btn_padding"><%--Added by shubham k on 11-Feb-21 for UBP--%>
                                                    <%--<asp:Button ID="btn_find" runat="server" Text="Find" CssClass="btn" Width="65px"
                                                        ToolTip="Find RM (s)" />--%>
                                                    <asp:Button ID="btn_find" runat="server" Text="Find" CssClass="btn" Width="65px"
                                                        ToolTip="Find Sales" />
                                                </td>
                                                <td class="btn_padding"><%--Added by shubham k on 11-Feb-21 for UBP--%>
                                                    <asp:Button ID="btnApply" runat="server" Text="Apply" CssClass="btn" Width="65px" />
                                                </td>
                                            </tr>
                                </tr>
                                <tr>
                                    <td style="height: 4px;" colspan="2"></td>
                                </tr>

                            </table>

                                        <table class="tbl ">
                                            <tr>
                                                <td style="white-space: nowrap;">
                                                    <asp:Label ID="lblErrorRMList" runat="server" CssClass="lblerror"></asp:Label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <%--Added by shubham k on 11-Feb-21 for UBP UI Standard--%>
                                                    
                                                    <asp:GridView ID="gridview_RM_List" runat="server" AllowPaging="True" CssClass="Grid frozenGrid" 
                                                        CaptionAlign="Top" AutoGenerateColumns="False"
                                                        PageSize="10">
                                                        <HeaderStyle Font-Bold="false" CssClass="GridHeader" />
                                                        <RowStyle CssClass="GridItem" />
                                                        <PagerStyle CssClass="GridPager" />
                                                        <SelectedRowStyle CssClass="GridItemSelect" />
                                                        <Columns>
                                                            <asp:TemplateField HeaderText="">
                                                                <ItemStyle HorizontalAlign="Center" />
                                                                <HeaderStyle HorizontalAlign="Center" />
                                                                <HeaderTemplate>
                                                                    <!-- Jira Number :- ANZDCIUPIN-83 Added by Shubham K on 22-Jun-2020 For ANZ--->
                                                                    <asp:CheckBox ID="chkALLRM" runat="server" AutoPostBack="true" Enabled="true" OnCheckedChanged="chkRM_CheckedChanged" />
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <asp:CheckBox ID="chkRMList" runat="server" AutoPostBack="true" Enabled="true" OnCheckedChanged="chkGrid_CheckedChanged" />
                                                                </ItemTemplate>
                                                                <ItemStyle HorizontalAlign="Center" Width="20px" Wrap="False" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField>
                                                                <HeaderTemplate>
                                                                    Sr No.
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <%# Container.DataItemIndex + 1 %>
                                                                </ItemTemplate>

                                                                <HeaderStyle Wrap="False" HorizontalAlign="Center" Font-Bold="False" />
                                                                <ItemStyle HorizontalAlign="Right" Width="50px" Wrap="False" />
                                                            </asp:TemplateField>
                                                              
                                                            <asp:BoundField DataField="DealerId" HeaderText="Sales Id">
                                                                <HeaderStyle Wrap="False" HorizontalAlign="Center" Font-Bold="False" />
                                                                <ItemStyle HorizontalAlign="Right" Width="70px" Wrap="False" />
                                                            </asp:BoundField>
                                                              
                                                            <asp:BoundField DataField="DealerName" HeaderText="Sales Name">
                                                                <HeaderStyle Wrap="False" HorizontalAlign="Center" Font-Bold="False" />
                                                                <ItemStyle HorizontalAlign="Left" Width="250px" Wrap="False" />
                                                            </asp:BoundField>
                                                        </Columns>
                                                    </asp:GridView>
                                                   
                                                </td>
                                            </tr>
                                        </table>
                                     </asp:Panel>
                                    </td>
                                </tr>
                            </table>


                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:HiddenField ID="hdnRMID" runat="server" />
                        <asp:HiddenField ID="hdnRMName" runat="server" />
						<%-- Start:  Added By Prajakta for ANZ 4.7 upgrade--%>
                          <asp:HiddenField ID="hdnMode" runat="server" />
                            <asp:HiddenField ID="hdnselectRM" runat="server" />
							<%--End   Added By Prajakta for ANZ 4.7 upgrade--%>
                        <asp:Panel ID="pnlViewMappedRM" runat="server" Visible="false " CssClass="filter" Style="width: 42%; padding: 5px; height: auto;"
                            ScrollBars="Auto">
                            <%-- top: 293px; left: 211px;--%>
                            <table class="tbl">
                                <tr>
                                      
                                    <td style="height: 28px; font-size: 13px;" class="lbl">Mapped Sales
                              <%--      </td>
                                    <td>--%>
                                         <asp:Label ID="lblTotalMappedRMRecords" runat="server" Style ="margin-left :20px;" CssClass="lbl">Total Record(s):</asp:Label>
                                        <asp:Label ID="lblMappedRMRecords" runat="server" CssClass="lbl" Width ="100"></asp:Label>
                                        <asp:Label ID="Label2" runat="server" Style ="margin-left :20px;" CssClass="lbl">Record(s) Per Page:</asp:Label>&nbsp;
                                         <asp:Button ID="btnPageCnt" runat="server" Text="" OnClick="txtMappedRMRowsPerPage_TextChanged" Style="display: none;" />
                                        <asp:TextBox ID="txtRowsPerPage" runat="server" MaxLength="2" Style="width: 30px; text-align: center;" CssClass="txt" onkeydown="EnterKeyEvent(event)" onkeypress="return isNumberKey(event)" onpaste="return false" oncut="return false"></asp:TextBox>
                    </td>

                                    </td>
                                    <td style="float: right;" class="btn_padding"><%--Added by shubham k on 11-Feb-21 for UBP--%>
                                        <asp:Button ID="btnviewrm" runat="server" CssClass="closeme" Text="X"
                                            ToolTip="close" />

                                    </td>
                                    <%--Added by shubham k on 11-Feb-21 for UBP--%>
                                  <%--  <td style="float: right;" class="btn_padding">
                                              <asp:Button ID="btnApplyMappedRMs" runat="server" CssClass="btn" 
                                            Text="Delete Mapping"  />
                                    </td>--%>
                                   
                                </tr>
                                <tr>
                                    <td style="height: 4px;" colspan="3"></td>
                                </tr>
                                <tr>
                                    <td  colspan="3">
                                        <table >
                                            <%--<tr>
                                                <td>
                                                    <asp:Label ID="Label2" runat="server" Text="RM List for Group" CssClass="lbl"></asp:Label>
                                                </td>
                                                <td>
                                                    <asp:Label ID="lbl_group_name" runat="server"></asp:Label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="3">
                                                    <asp:Label ID="lblErrorViewRM" runat="server" CssClass="lblinfo_Panel"></asp:Label>
                                                </td>
                                            </tr>--%>
                                              <tr>
                                                <td class="btn_padding"><%--Added by shubham k on 11-Feb-21 for UBP--%>
                                                      
                                                    <asp:Label ID="Label4" runat="server" Text="Sales Name" CssClass="lbl"></asp:Label>
                                                </td>
                                                <td class="btn_padding"><%--Added by shubham k on 11-Feb-21 for UBP--%>
                                                    <asp:TextBox ID="txtMappedRMs" runat="server" CssClass="txt" onkeydown="EnterKeySearchByMappedRM(event)" ></asp:TextBox>
                                                </td>
                                                <td class="btn_padding"><%--Added by shubham k on 11-Feb-21 for UBP--%>
                                                      
                                                    <asp:Button ID="btnMappedRMFind" runat="server" Text="Find" CssClass="btn" Width="65px"
                                                        ToolTip="Find Sales" />
                                                </td>
                                                <td class="btn_padding"><%--Added by shubham k on 11-Feb-21 for UBP--%>
                                                    <asp:Button ID="btnApplyMappedRMs" runat="server" Text="Delete Mapping" CssClass="btn" Width="188px" />
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="height: 4px;" colspan="3"></td>
                                </tr>
                            </table>
                            <table class="tbl">
                                <tr>
                                    <td>
                                        <asp:GridView ID="grd_viewgroup" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                                            CssClass="Grid frozenGrid"> <%--Added by shubham k on 11-Feb-21 for UBP--%>
                                            <HeaderStyle Font-Bold="false" CssClass="GridHeader" />
                                            <RowStyle CssClass="GridItem" />
                                            <PagerStyle CssClass="GridPager" />
                                            <FooterStyle CssClass="GridFooter" />
                                            <SelectedRowStyle CssClass="GridItemSelect" />
                                            <Columns>
                                                <asp:TemplateField>
                                                    <HeaderStyle />
                                                    <ItemStyle HorizontalAlign="Center" />
                                                    <HeaderStyle HorizontalAlign="Center" />
                                                    <HeaderTemplate>
                                                        <!-- Jira Number :- ANZDCIUPIN-83 Added by Shubham K on 22-Jun-2020 For ANZ--->
                                                        <asp:CheckBox ID="chkALLRM"  runat="server" AutoPostBack="true" OnCheckedChanged="chkALLRM_CheckedChanged" />
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="chkRMList" runat="server" AutoPostBack="true" OnCheckedChanged="chkGridView_CheckedChanged" />
                                                    </ItemTemplate>
                                                    <ItemStyle HorizontalAlign="Center" Width="20px" Wrap="False" />
                                                </asp:TemplateField>
                                                <asp:TemplateField ItemStyle-Width="50px">
                                                    <HeaderTemplate>
                                                        Sr No.
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%# Container.DataItemIndex + 1 %>
                                                    </ItemTemplate>
                                                    <HeaderStyle Wrap="False" Font-Bold="False" />
                                                    <ItemStyle HorizontalAlign="Right" />
                                                </asp:TemplateField>
                                                  
                                                <asp:BoundField DataField="RM_Key" HeaderText="Sales Key">
                                                    <HeaderStyle Font-Bold="False" Wrap="False" Width="100px" />
                                                    <ItemStyle HorizontalAlign="Left" Wrap="False" Width="100px" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="Rel_Manager_Name" HeaderText="Rel Manager Name">
                                                    <HeaderStyle Font-Bold="False" Width="250px" />
                                                    <ItemStyle HorizontalAlign="Left" Wrap="False" Width="250px" />
                                                </asp:BoundField>
                                                  
                                                <asp:BoundField DataField="DealerId" HeaderText="Sales Id">
                                                    <HeaderStyle Font-Bold="False" Wrap="false" />
                                                    <ItemStyle HorizontalAlign="Right" Wrap="False" Width="50px" />
                                                </asp:BoundField>
                                            </Columns>
                                        </asp:GridView>
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                    </td>
                </tr>
                <tr>
                    <td>
                        <table class="tbl">
                            <tr>
                                <td>
                                    <asp:HiddenField ID="hdnEnableMainRMGroupHistory" runat="server" />
                                </td>
                                <td>
                                    <asp:HiddenField ID="hdnDelayAutoMappingInRMGrouping" runat="server" />
                                </td>
                                <td>
                                    <asp:HiddenField ID="hdnNewGroupOrNot" runat="server" />
                                </td>
                                <td>
                                    <asp:HiddenField ID="hdnStoreIDFieldsInLRCMappingTables" runat="server" />
                                </td>
                                <td>
                                    <asp:HiddenField ID="hdnAutoRefreshLRCForNewRM" runat="server" />
                                </td>
                                <td></td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:HiddenField ID="hdnIdentityRCGM" runat="server" />
                                </td>
                                <td>
                                    <asp:HiddenField ID="hdnIdentityLRGM" runat="server" />
                                </td>
                                <td>
                                    <asp:HiddenField ID="hdnEnableGroupBasedAutoLRMap" runat="server" />
                                </td>
                                <td>
                                    <asp:HiddenField ID="hdnEnableCustomerRMMapHistory" runat="server" />
                                </td>
                                <td>
                                    <asp:HiddenField ID="hdnInsertAuditTrailForAutoLRCMapping" runat="server" />
                                </td>
                                <td>
                                    <asp:HiddenField ID="hdnAutoRefreshLRCConfirmationMessage" runat="server" />
                                </td>
                                <td>
                                  <%--  Changed by Rushikesh P on 28-Jun-2020 for confirmation dialog--%>
                                    <%--<asp:Button ID="btnConfirmationForDelete" runat="server" Width="0" Style="width: 0px; height: 0px; font-size: 0; border: none; display: none;" />--%>
                                    <%--<asp:HiddenField ID="hdnbtnName" runat="server" />--%>
                                       <%--<asp:Button ID="btnCnfrmDeleteGp" runat="server" Width="0" Style="width: 0px; height: 0px; font-size: 0; border: none; display: none;" />--%>
                                    
                                    <%--Changed by Rushikesh P on 28-Jun-2020 for confirmation dialog--%>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:Button ID="btnConfirmationForDelete" runat="server" Width="0" Style="width: 0px; height: 0px; font-size: 0; border: none; display: none;" />
    <asp:HiddenField ID="hdnbtnName" runat="server" />
    <asp:Button ID="btnCnfrmDeleteGp" runat="server" Width="0" Style="width: 0px; height: 0px; font-size: 0; border: none; display: none;" />
</asp:Content>
