<%@ Page Title="Sales Counterparty Mapping" Language="vb" AutoEventWireup="false" MasterPageFile="~/FiniqAppMasterPage.Master"
    CodeBehind="CustomerRMMapping.aspx.vb" Inherits="FinIQWebApp.CustomerRMMapping" %>
 <%--'Replaced Customer with Counterparty and RM with Sales by Apurva K in all labels and messages || 25 May 2022|| Assigned by DJ--%>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <link href="App_Themes/Style1.css" rel="stylesheet" type="text/css" />
    <%--    <script src="CustomerRMMapping.js" language="javascript" type="text/javascript"></script>--%>

    <style>
        .ButtonEnableDisable:disabled
        {
            /*color: #8ca2bb !important;*/
            color: #c9c5c0 !important;
        }

        .ButtonEnableDisable:enabled
        {
            color: #ffffff !important;
        }

        .ddlEntityWidth
        {
            width: 185px !important;
        }
    </style>

    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    </asp:ScriptManagerProxy>
        <script type="text/javascript">

            var dialogConfirmed = false;
            function ViewDialogDuplicate(obj, title, dialogText) {
                if ($("#pageName").html() != null) {
                }
                if (!dialogConfirmed) {
                    $('html').append(String.Format("<div id='dialog' title='{0}'><div class='ui-icon ui-icon-alert' style='float:left; 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 (obj == "btnhdnDelete") {
                                            $("#ctl00_MainContent_btnhdnDelete").click();
                                        }
                                        else {
                                            $("#ctl00_MainContent_btnhdnMapped").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(evt) {
                var code = (evt.which) ? evt.which : evt.keyCode;

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

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

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

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

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

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

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

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

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

    </script>

    <asp:UpdatePanel ID="Updatepanel1" runat="server">
        <ContentTemplate>
            <table>
                <tr>
                    <td>
                        <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="Updatepanel1"
                            DisplayAfter="0">
                            <ProgressTemplate>
                                <div style="position: absolute; left: 430px; top: 60px;">
                                    <img alt="Loading" src="../App_Resources/loading.gif" /><span class="lbl">Loading...
                                    </span>
                                </div>
                            </ProgressTemplate>
                        </asp:UpdateProgress>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblError" runat="server" CssClass="lblerror"></asp:Label>
                        <asp:Label ID="lblWarning" runat="server" CssClass="lblinfo"></asp:Label>
                        <asp:Label ID="lblInfo" runat="server" CssClass="lblsuccess"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <table>
                            <tr>
                                <td class="ctlBlotterPaddingRight">
                                    <asp:Label ID="lblEntity" runat="server" CssClass="lbl" Text="<%$ Resources:LocalizedText, Entity %>">  </asp:Label>
                                </td>
                                <td class="ctlBlotterPaddingRight">
                                    <asp:DropDownList ID="lstEntity" runat="server" CssClass="ddl ddlEntityWidth" AutoPostBack="true">
                                    </asp:DropDownList>
                                </td>
                                <td class="lblBlotterPaddingRight">
                                    <asp:Label ID="lblHomeEntity" runat="server" CssClass="lbl" Text="Home Entity"> </asp:Label>
                                </td>
                                <td class="lblBlotterPaddingRight">
                                    <asp:Label ID="lblHomeEntityVal" runat="server" CssClass="lbl"></asp:Label>
                                </td>
                                <td></td>
                                <td></td>

                            </tr>
                        </table>
                        <table>
                            <tr>
                                <td>
                                     
                                    <asp:Button ID="btnViewMappedRC" runat="server" CssClass="btn" Text="View Mapped Counterparty(s)"
                                        ToolTip="View mapped counterparty(s)" Width="262px" />

                                </td>
                                <td>
                                      
                                    <asp:Button ID="btnViewUnMappedRC" runat="server" CssClass="btn" Text="View Unmapped Counterparty(s)" Width="262px"
                                        ToolTip="View unmapped counterparty(s)" />

                                </td>
                                <td class="ctlBlotterPaddingRight">
                                    <asp:Button ID="btnUpdate" runat="server" CssClass="btn" Text="Update Mapping" Style="width: 262px;" />
                                </td>


                                <%--                          <td>
                                    <asp:Button ID="btnViewUnMappedRC" runat="server" CssClass="btn" Text="View Unmapped Customers" Width ="234px"
                                        ToolTip="View unmapped Customer(s)" />
                                 
                                </td>--%>


                                <td class="ctlBlotterPaddingRight">
                                    <asp:RadioButton ID="radgroup" runat="server" AutoPostBack="true"  CssClass="RadioBtn" Text="Group" GroupName="rad" Style="margin-left: 0px"></asp:RadioButton>

                                    <asp:RadioButton ID="radindividual" runat="server" AutoPostBack="true" Checked ="true" CssClass="RadioBtn" Text="Individual" GroupName="rad"></asp:RadioButton>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>

                <tr>
                    <td style="height: 10px"></td>
                </tr>

                <tr>
                    <td>
                        <table style="width: 1085px">
                            <tr>
                                <td align="left">
                                   
                                    <asp:CheckBox ID="chkAllRMGrp" runat="server" Text="All Sales group(s)" AutoPostBack="true"
                                        Checked="True" ToolTip="Show all Sales group(s)" />

                                     
                                    <asp:Button ID="btnsearchRMGroup" CssClass="btn" runat="server" Text="Find" Width="65px" Style="float: right;"
                                        Enabled="False" ToolTip="Find Sales group(s)" />


                                    <asp:Panel ID="pnlFindRMGroup" CssClass="filter" Style="position: absolute; top: 207px; left: 220px; height: auto; padding: 5px; width: auto; background-color: #ffffff; border: 1px solid #cccccc"
                                        Visible="false" runat="server" ScrollBars="None">
                                        <table class="tbl">
                                            <tr>
                                                <td>
                                                    
                                                    <asp:Label ID="Label1" runat="server" CssClass="lbl" Text="Sales Group(s)"></asp:Label>
                                                </td>
                                                <%--      </tr>
                                                    <tr>--%>
                                                <td style="float: right;">
                                                    <asp:Button ID="btnCloseRMgroup" runat="server" CssClass="btn" Text="X" ToolTip="close" Width="25" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2" style="height: 4px;"></td>
                                            </tr>
                                            <tr>
                                                <td colspan="2">
                                                    <table>
                                                        <tr>
                                                            <td class="lblBlotterPaddingRight">
                                                                
                                                                <asp:Label ID="lblRMGroup" runat="server" Text="Sales Group"></asp:Label>
                                                            </td>
                                                            <td class="ctlBlotterPaddingRight">
                                                                <asp:TextBox ID="txtRMGroup" onkeydown="EnterKeySearchByRMGroup(event)" runat="server"></asp:TextBox>
                                                            </td>
                                                            <td>
                                                                 
                                                                <asp:Button ID="btnFindRMGroup" runat="server" CssClass="btn" Text="Find" ToolTip="Search Sales group(s)" Width="65px" />
                                                            </td>
                                                            <td>
                                                                 
                                                                <asp:Button ID="btnApplyRMGroup" runat="server" CssClass="btn" Text="Apply" ToolTip="Apply Sales group(s)" Width="65px" />
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2">
                                                    <asp:Label ID="lblErrorRMGroup" runat="server" CssClass="lblinfo" ></asp:Label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2" style="height: 4px;"></td>
                                            </tr>
                                            <tr>
                                                <td colspan="2">
                                                    <asp:DataGrid ID="dgRMGroup" runat="server" AllowPaging="True" AutoGenerateColumns="False" BorderStyle="None" CssClass="Grid" PageSize="10" Width="263px">
                                                        <HeaderStyle CssClass="GridHeader" />
                                                        <ItemStyle CssClass="GridItem" Wrap="False" />
                                                        <PagerStyle CssClass="GridPager" Mode="NumericPages" />
                                                        <Columns>

                                                            <asp:TemplateColumn>
                                                                <HeaderStyle HorizontalAlign="Right" />
                                                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                                <HeaderTemplate>
                                                                    <asp:CheckBox ID="chkAllItems" runat="server" onclick="SelectSearchRMGroup(this)" Text="" />
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <asp:CheckBox ID="chkSelectedRMGroup" runat="server" onclick="chkAllCheckBoxRMGroup(this)" />
                                                                </ItemTemplate>
                                                                <ItemStyle HorizontalAlign="center" />
                                                            </asp:TemplateColumn>
                                                            <asp:BoundColumn HeaderText="Sr No">
                                                                <HeaderStyle Wrap="False" HorizontalAlign="Center" />
                                                                <ItemStyle HorizontalAlign="Right" />
                                                            </asp:BoundColumn>
                                                            
                                                            <asp:BoundColumn DataField="RM_Group_Key" HeaderText="Sales Group Key">
                                                                <HeaderStyle Wrap="False" />
                                                                <ItemStyle />
                                                            </asp:BoundColumn>
                                                            
                                                            <asp:BoundColumn DataField="RM_Group_Name" HeaderText="Sales Group Name">
                                                                <HeaderStyle Wrap="False" />
                                                                <ItemStyle />
                                                            </asp:BoundColumn>
                                                        </Columns>
                                                    </asp:DataGrid>
                                                </td>
                                            </tr>

                                        </table>
                                    </asp:Panel>
                                    <asp:Panel ID="pnlRMName" CssClass="filter" Visible="false" Style="position: absolute; padding: 5px; top: 205px; left: 465px; height: auto; width: auto; background-color: #ffffff; border: 1px solid #cccccc"
                                        runat="server" ScrollBars="Auto">
                                        <table class="tbl">
                                            <tr>
                                                
                                                <td class="lbl ">Sales List(s)
                                                </td>
                                                <td style="float: right;">
                                                    <asp:Button ID="btnCloseRMList" runat="server" CssClass="btn" Text="X"
                                                        ToolTip="close" Width="25" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2" style="height: 4px;">
                                            </tr>
                                            <tr>
                                                <td colspan="2">
                                                    <table>
                                                        <tr>
                                                            
                                                            <td class="lbl lblBlotterPaddingRight">Sales Name
                                                            </td>
                                                            <td class="ctlBlotterPaddingRight">
                                                                <asp:TextBox ID="txtSearchRMList" runat="server" onkeydown="EnterKeySearchByRM(event)"></asp:TextBox>

                                                            </td>
                                                            <td >
                                                                 
                                                                <asp:Button ID="btnFindRMList" CssClass="btn" Width="65px" ToolTip="Search Sales"
                                                                    runat="server" Text="Find" />
                                                            </td>
                                                            <td>
                                                                 
                                                                <asp:Button ID="btnApplyRMName" CssClass="btn" runat="server" Text="Apply" ToolTip="Apply Sales"
                                                                    Width="65px" />
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>

                                            </tr>

                                            <tr>
                                                <td colspan="2">
                                                    <asp:Label ID="lblErrorRMList" runat="server" CssClass="lblinfo"></asp:Label>
                                                    <%--ForeColor="#66a3ff"--%>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2" style="height: 4px;">
                                            </tr>
                                            <tr>
                                                <td colspan="2">
                                                    <asp:DataGrid ID="dgRMList" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                                                        BorderStyle="None" CssClass="Grid" PageSize="10">
                                                        <HeaderStyle CssClass="GridHeader" />
                                                        <ItemStyle CssClass="GridItem" Wrap="False" />
                                                        <PagerStyle CssClass="GridPager" Mode="NumericPages" />
                                                        <Columns>
                                                            <asp:TemplateColumn>
                                                                <HeaderStyle HorizontalAlign="Center" />
                                                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                                <HeaderTemplate>
                                                                    <asp:CheckBox ID="chkAllItems" runat="server" Text="" onclick="SelectSearchRMList(this)" />
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <asp:CheckBox ID="chkSelectedRMList" runat="server" onclick="chkAllCheckBoxRM(this)" />
                                                                </ItemTemplate>
                                                            </asp:TemplateColumn>
                                                            <asp:BoundColumn HeaderText="Sr No">
                                                                <HeaderStyle Wrap="False" HorizontalAlign="Center"></HeaderStyle>
                                                                <ItemStyle HorizontalAlign="Right"></ItemStyle>
                                                            </asp:BoundColumn>
                                                            
                                                            <asp:BoundColumn DataField="RM_Id" HeaderText="Sales ID">
                                                                <HeaderStyle Wrap="False"></HeaderStyle>
                                                                <ItemStyle HorizontalAlign="Right"></ItemStyle>
                                                            </asp:BoundColumn>
                                                            
                                                            <asp:BoundColumn DataField="Rel_manager_name" HeaderText="Sales Name">
                                                                <HeaderStyle Wrap="False"></HeaderStyle>
                                                                <ItemStyle></ItemStyle>
                                                            </asp:BoundColumn>
                                                        </Columns>
                                                    </asp:DataGrid>
                                                </td>
                                            </tr>
                                        </table>
                                    </asp:Panel>
                        <asp:Panel ID="pnlMcustomerGroup" CssClass="filter" Visible="false" Style="position: absolute; padding: 5px; top: 209px; left: 725px; height: auto; width: auto; background-color: #ffffff; border: 1px solid #cccccc"
                            runat="server" ScrollBars="None">
                            <table class="tbl">
                                <tr>
                                     
                                    <td class="lbl">Counterparty Group(s)
                                    </td>
                                    <td style="float: right;">
                                        <asp:Button ID="btnCloseMCustomerGroup" runat="server" CssClass="btn"
                                                        Text="X" ToolTip="close" Width="25" />
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2" style="height: 4px;"></td>
                                </tr>
                                <tr>
                                    <td>
                                        <table>
                                            <tr>

                                                <td class="lblBlotterPaddingRight">
                                                      
                                                    <asp:Label ID="lblCustGroup" runat="server" Text="Counterparty Group">

                                                    </asp:Label>
                                                </td>
                                                <td class="ctlBlotterPaddingRight">
                                                                <asp:TextBox ID="txtFindCustomerGroup" runat="server" onkeydown="EnterKeySearchByCustomerGroup(event)"></asp:TextBox>

                                                </td>
                                                <td>
                                                      
                                                    <asp:Button ID="btnFindCustomerGroup" CssClass="btn" Width="65px" ToolTip="Search mapped counterparty group(s)"
                                                        runat="server" Text="Find" />
                                                </td>
                                                <td>
                                                      
                                                    <asp:Button ID="btnApplyCustomerGroup" CssClass="btn" runat="server" Text="Apply"
                                                        ToolTip="Apply mapped counterparty group(s)" Width="65px" />
                                                </td>

                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                                    <asp:Label ID="lblErrorCustomerGroup" runat="server" CssClass="lblinfo"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2" style="height: 4px;"></td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <asp:DataGrid ID="dgMCustmerGroup" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                                            BorderStyle="None" Width="349px" CssClass="Grid" PageSize="10">
                                            <HeaderStyle CssClass="GridHeader" />
                                            <ItemStyle CssClass="GridItem" Wrap="False" />
                                            <PagerStyle CssClass="GridPager" Mode="NumericPages" />
                                            <Columns>
                                                <asp:TemplateColumn>
                                                                <HeaderStyle HorizontalAlign="Right" />
                                                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                    <HeaderTemplate>
                                                        <asp:CheckBox ID="chkAllItems" runat="server" Text="" onclick="SelectSearchCustomergroup(this)" />
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="chkSelectedCustomerGroup" runat="server" onclick="chkAllCheckCustomerRM(this)" />
                                                    </ItemTemplate>
                                                </asp:TemplateColumn>
                                                <asp:BoundColumn HeaderText="Sr No">
                                                    <HeaderStyle Wrap="False" HorizontalAlign="Center"></HeaderStyle>
                                                    <ItemStyle HorizontalAlign="Right"></ItemStyle>
                                                </asp:BoundColumn>
                                                
                                                <asp:BoundColumn DataField="RM_GS_Type" HeaderText="Sales GS Type">
                                                    <HeaderStyle Wrap="False"></HeaderStyle>
                                                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                </asp:BoundColumn>
                                                 
                                                <asp:BoundColumn DataField="Customer_Group_Name" HeaderText="Counterparty Group Name">
                                                    <HeaderStyle Wrap="False"></HeaderStyle>
                                                    <ItemStyle></ItemStyle>
                                                </asp:BoundColumn>
                                            </Columns>
                                        </asp:DataGrid>
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                        <asp:Panel ID="pnlMCustomer" CssClass="filter" Visible="false" Style="position: absolute; padding: 5px; top: 204px; left: 790px; height: auto; width: auto; background-color: #ffffff; border: 1px solid #cccccc"
                            runat="server" ScrollBars="None">
                            <table class="tbl">
                                <tr>
                                     
                                    <td class="lbl">Counterparty(s)
                                    </td>
                                    <td style="float: right;">
                                        <asp:Button ID="btnCloseMCustomer" runat="server" CssClass="btn" Text="X"
                                                        ToolTip="close" Width="25" />
                                    </td>
                                </tr>
                                            <tr>
                                                <td style="height: 4px;"></td>
                                            </tr>
                                <tr>
                                    <td colspan="2">
                                        <table>
                                            <tr>
                                                <td class="lblBlotterPaddingRight">
                                                      
                                                    <asp:Label ID="lblSearchMCustomer" runat="server" Text="Counterparty Name"></asp:Label>
                                                </td>
                                                <td  class="ctlBlotterPaddingRight">
                                                                <asp:TextBox ID="txtSearchMCustomer" runat="server" onkeydown="EnterKeySearchByMCustomer(event)"></asp:TextBox>
                                                </td>
                                                <td>
                                                      
                                                    <asp:Button ID="btnFindMCustomer" CssClass="btn" Width="65px" runat="server" Text="Find"
                                                        ToolTip="Search mapped Counterparty(s)" />
                                                </td>
                                                <td>
                                                      
                                                    <asp:Button ID="btnApplyMCustomer" CssClass="btn" runat="server" Text="Apply" ToolTip="Apply mapped counterparty(s)" 
                                                        Width="65px" />
                                                </td>
                                            </tr>
                                        </table>

                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                                    <asp:Label ID="lblErrorMCustomer" runat="server" CssClass="lblinfo"></asp:Label>
                                    </td>
                                </tr>
                                            <tr>
                                                <td style="height: 4px;"></td>
                                            </tr>
                                <tr>
                                    <td colspan="2">
                                        <asp:DataGrid ID="dgMCustomer" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                                            BorderStyle="None" Width="371px" CssClass="Grid" PageSize="10">
                                            <HeaderStyle CssClass="GridHeader" />
                                            <ItemStyle CssClass="GridItem" Wrap="False" />
                                            <PagerStyle CssClass="GridPager" Mode="NumericPages" />
                                            <Columns>
                                                <asp:TemplateColumn>
                                                                <HeaderStyle HorizontalAlign="Right" />
                                                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                    <HeaderTemplate>
                                                        <asp:CheckBox ID="chkAllItems" runat="server" Text="" onclick="SelectSearchMCustomer(this)" />
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="chkSelectedMCustomer" runat="server" onclick="chkAllCheckCustomer(this)" />
                                                    </ItemTemplate>
                                                </asp:TemplateColumn>
                                                <asp:BoundColumn HeaderText="Sr No">
                                                    <HeaderStyle Wrap="False" HorizontalAlign="Center"></HeaderStyle>
                                                    <ItemStyle HorizontalAlign="Right"></ItemStyle>
                                                </asp:BoundColumn>
                                                 
                                                <asp:BoundColumn DataField="Customer_Name" HeaderText="Counterparty Name">
                                                    <HeaderStyle Wrap="False"></HeaderStyle>
                                                    <ItemStyle></ItemStyle>
                                                </asp:BoundColumn>
                                                
                                                <asp:BoundColumn DataField="Customer_ID" HeaderText="CounterpartyId">
                                                    <HeaderStyle Wrap="False"></HeaderStyle>
                                                    <ItemStyle HorizontalAlign="Right"></ItemStyle>
                                                </asp:BoundColumn>
                                            </Columns>
                                        </asp:DataGrid>
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                        <asp:Panel ID="pnlUCustomerGroup" CssClass="filter" Style="position: absolute; top: 209px; left: 725px; height: 378px; width: 470px; border: 1px solid #cccccc;"
                            Visible="false" runat="server" ScrollBars="Both">
                            <table class="tbl">
                                <tr>
                                    
                                    <td style="width: 398px">Counterparty Group(s)
                                    </td>
                                    <td align="right">
                                        <asp:Button ID="btnCloseUCustomerGroup" runat="server" CssClass="btn"
                                                        Text="X" ToolTip="close" Width="18" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        
                                        <asp:Label ID="lblCustGroup1" runat="server" Text="Counterparty Group"></asp:Label>
                                                    <asp:TextBox ID="txtSearchuCustomerGroup" runat="server" onkeydown="EnterKeySearchByuCustomerGroup(event)"></asp:TextBox>
                                        &nbsp;
                                                     
                                        <asp:Button ID="btnFindUCustomerGroup" CssClass="btn" Width="65px" runat="server"
                                                        Text="Find" ToolTip="Search unmapped counterparty group(s)" />
                                        
                                        <asp:Button ID="btnApplyUCustomerGroup" CssClass="btn" runat="server" Text="Apply" Style="margin-left: 10px;"
                                            ToolTip="Apply unmapped counterparty group(s)" Width="65px" />
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 398px">
                                                    <asp:Label ID="lblErrorUCustomerGroup" runat="server" CssClass="lblinfo"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 398px">
                                        <asp:DataGrid ID="dgUCustomerGroup" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                                            BorderStyle="None" Width="366px" CssClass="Grid" PageSize="10">
                                            <HeaderStyle CssClass="GridHeader" />
                                            <ItemStyle CssClass="GridItem" Wrap="False" />
                                            <PagerStyle CssClass="GridPager" Mode="NumericPages" />
                                            <Columns>
                                                <asp:TemplateColumn>
                                                    <ItemStyle HorizontalAlign="Center" />
                                                    <HeaderStyle HorizontalAlign="Center" />
                                                    <HeaderTemplate>
                                                        <asp:CheckBox ID="chkAllItems" runat="server" Text="" onclick="SelectSearchUCustomerGroup(this)" />
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="chkSelectedUCustomerGroup" runat="server" />
                                                    </ItemTemplate>
                                                </asp:TemplateColumn>
                                                <asp:BoundColumn HeaderText="Sr No">
                                                    <HeaderStyle Wrap="False" HorizontalAlign="Center"></HeaderStyle>
                                                    <ItemStyle HorizontalAlign="Right"></ItemStyle>
                                                </asp:BoundColumn>
                                                
                                                <asp:BoundColumn DataField="CustomerGroup" HeaderText="Counterparty Group Name">
                                                    <HeaderStyle Wrap="False"></HeaderStyle>
                                                    <ItemStyle></ItemStyle>
                                                </asp:BoundColumn>
                                                <%-- <asp:BoundColumn DataField="RM_Group_Name"   HeaderText="RM Group Name">
									<HeaderStyle Wrap="False"></HeaderStyle>
									<ItemStyle  ></ItemStyle>
								</asp:BoundColumn>
                                                --%>
                                            </Columns>
                                        </asp:DataGrid>
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                                    <asp:Panel ID="pnlUCustomer" CssClass="filter" Style="position: absolute; top: 204px; left: 790px; height: 381px; width: 500px; border: 1px solid #cccccc;"
                            Visible="false" runat="server" ScrollBars="Both">
                            <table class="tbl">
                                <tr>
                                    
                                    <td style="width: 398px">Counterparty List
                                    </td>

                                            </tr>
                                            <tr>
                                                <td>
                                                     
                                                    <asp:Label ID="lblSearchUCustomer" runat="server" Text="Counterparty Name"> </asp:Label>
                                                    <asp:TextBox ID="txtSearchUCustomer" runat="server" onkeydown="EnterKeySearchByUCustomer(event)"></asp:TextBox>
                                                    &nbsp;

                                                     
                                                    <asp:Button ID="btnFinduCustomer" CssClass="btn" Width="65px" runat="server" Text="Find"
                                                        ToolTip="Search unmapped Counterparty(s)" />
                                                     
                                                    <asp:Button ID="btnApplyUCustomer" CssClass="btn" runat="server" Text="Apply" ToolTip="Apply unmapped Counterparty(s)" Style="margin-left: 10px;"
                                                        Width="65px" />
                                                    <td align="right">
                                                        <asp:Button ID="btnCloseuCustomer" runat="server" CssClass="btn" Height="25" Text="X"
                                                            ToolTip="close" Width="25" />
                                                    </td>

                                                </td>
                                </tr>
                                <tr>
                                    <td style="width: 398px">
                                                    <asp:Label ID="lblErrorUCustomer" runat="server" CssClass="lblinfo"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 398px">
                                        <asp:DataGrid ID="dgUCustomer" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                                            BorderStyle="None" Width="349px" CssClass="Grid" PageSize="10">
                                            <HeaderStyle CssClass="GridHeader" />
                                            <ItemStyle CssClass="GridItem" Wrap="False" />
                                            <PagerStyle CssClass="GridPager" Mode="NumericPages" />
                                            <Columns>
                                                <asp:TemplateColumn>
                                                    <ItemStyle />
                                                    <HeaderStyle />
                                                    <HeaderTemplate>
                                                        <asp:CheckBox ID="chkAllItems" runat="server" Text="All" onclick="SelectSearchUCustomer(this)" />
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="chkSelectedUCustomer" runat="server" onclick="chkAllCheckCustomer(this)" />
                                                    </ItemTemplate>
                                                </asp:TemplateColumn>
                                                <asp:BoundColumn HeaderText="Sr No">
                                                    <HeaderStyle Wrap="False" HorizontalAlign="Center"></HeaderStyle>
                                                    <ItemStyle HorizontalAlign="Right"></ItemStyle>
                                                </asp:BoundColumn>
                                                
                                                <asp:BoundColumn DataField="CustomerId" HeaderText="Counterparty Id">
                                                    <HeaderStyle Wrap="False"></HeaderStyle>
                                                    <ItemStyle HorizontalAlign="Right"></ItemStyle>
                                                </asp:BoundColumn>
                                                
                                                <asp:BoundColumn DataField="Customer_Name" HeaderText="Counterparty Name">
                                                    <HeaderStyle Wrap="False"></HeaderStyle>
                                                    <ItemStyle></ItemStyle>
                                                </asp:BoundColumn>
                                            </Columns>
                                        </asp:DataGrid>
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                    </td>
                    <td align="left">
                        
                        <asp:CheckBox ID="chkAllRM" runat="server" AutoPostBack="true" Text="All Sales" Checked="True"
                            ToolTip="Show all Sales" />

                         
                        <asp:Button ID="btnsearchRMName" runat="server" CssClass="btn" Text="Find" Width="62px" Style="float: right;"
                            Enabled="False" ToolTip="Find Sales" />
                        &nbsp;
                    </td>
                    <td>
                        
                        <asp:CheckBox ID="chkAllCustomergroup" runat="server" Checked="true" AutoPostBack="true"
                            ToolTip="Show all mapped counterparty group(s)" Text="All mapped counterparty group(s)" />

                         
                        <asp:Button ID="btnsearchCustomerGroup" runat="server" CssClass="btn" Text="Find" Style="float: right"
                            Width="62px" Enabled="False" ToolTip="Find mapped counterparty group(s)" />
                    </td>
                    <td>
                         
                        <asp:CheckBox ID="chkAllCustomer" runat="server" AutoPostBack="true" ToolTip="Select all mapped counterparty(s)" />
                        
                        
                        <asp:CheckBox ID="chkAllCustomers" runat="server" Text="All Counterpaty(s)" AutoPostBack="true"
                            ToolTip="Show all mapped counterparty(s)" Checked="True" />

                        <%--<asp:Label ID="lblCustomer" runat="server"  >Customer(s)</asp:Label>--%>
                         
                        <asp:Button ID="btnsearchCustomer" runat="server" CssClass="btn" Text="Find" Width="62px" Style="float: right"
                            Enabled="False" ToolTip="Find mapped counterparty(s)" />
                    </td>
                </tr>
                <tr>
                    <td valign="top">
                        <table class="Filter">
                            <tr>
                                <td>
                                                <div id="div1" style="z-index: 1; overflow: auto; width: 253px; height: 634px">
                                        <asp:RadioButtonList ID="radlstRMGrp" runat="server" AutoPostBack="true" CssClass="RadioBtn" Style="padding-left: 0px">
                                        </asp:RadioButtonList>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td valign="top">
                        <table class="Filter">
                            <tr>
                                <td>
                                                <div id="div2" style="z-index: 1; overflow: auto; width: 253px; height: 634px">
                                        <asp:RadioButtonList ID="radlstRM" runat="server" AutoPostBack="true" CssClass="RadioBtn" OnSelectedIndexChanged="radlstRM_SelectedIndexChanged">
                                        </asp:RadioButtonList>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </td>
                                <td valign="top" >
                        <table class="Filter">
                            <tr>
                                <td>
                                                <div id="div3" style="z-index: 1; overflow: auto; width: 266px; height: 634px">
                                        <asp:RadioButtonList ID="radlstCustGrp" runat="server" AutoPostBack="true" CssClass="RadioBtn">
                                        </asp:RadioButtonList>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td valign="top">
                        <table class="Filter">
                            <tr>
                                <td>
                                                <div id="div4" style="z-index: 1; overflow: auto; width: 367px; height: 634px">
                                        <asp:CheckBoxList ID="chklstCustomer" runat="server" AutoPostBack="true" CssClass="RadioBtn" OnTextChanged="chklstCustomer_TextChanged">
                                        </asp:CheckBoxList>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
                    </td>
                </tr>
            </table>
		      <%-- <Change done by Nitin N : 06-Dec-2021 : UBPINT-1719 Customer RM Mapping: Logout on mapping/unmapping customer.> --%>
                <asp:Button ID="btnhdnDelete" runat="server" Width="0" Style="width: 0px; height: 0px; font-size: 0; border: none; display: none;" />
                <asp:Button ID="btnhdnMapped" runat="server" Width="0" Style="width: 0px; height: 0px; font-size: 0; border: none; display: none;" />
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
