<%@ page title="" language="VB" masterpagefile="~/Template/Master.master" autoeventwireup="false" inherits="RCC_O365_Tenants, MachSol.MachPanel.Web" %>

<%@ Register Assembly="MachSol.MachPanel.Utility" Namespace="MachSol.MachPanel.Utility" TagPrefix="EM" %>
<%@ Register Assembly="obout_Editor" Namespace="OboutInc.Editor" TagPrefix="obout" %>
<%@ Register Assembly="AjaxControls" Namespace="AjaxControls" TagPrefix="EM" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="EM" %>
<%@ Register Src="~/Template/GVPager.ascx" TagName="Pager" TagPrefix="UC" %>
<%@ Register Assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="System.Web.UI" TagPrefix="cc1" %>
<%@ Register Src="~/RCC/O365/CC/TenantMissingServicePrincipalControl.ascx" TagName="TenantServicePrincipalError" TagPrefix="EM" %>

<asp:Content ID="Content5" ContentPlaceHolderID="CPH_Content" runat="Server">

    <div class="col-xs-12">
        <div class="card">
            <div class="body">
                <asp:Button ID="Btn_RefreshTab" CssClass="RefreshTab" runat="server" Style="display: none;" />
                <EM:TabContainer ID="TbCntr_Tenants" runat="server" OnClientActiveTabChanged="loadTabPanel">

                    <EM:TabPanel ID="Tab_Tenants" runat="server" HeaderText="<%$ Resources:Content,O365Tenants %>">

                        <ContentTemplate>
                            <asp:Button ID="Btn_Tab0" runat="server" Style="display: none;" />
                            <asp:Panel ID="Pnl_TabContent0" runat="server">
                                <asp:Panel ID="Pnl_Listing" runat="server" DefaultButton="Btn_ApplyFilter">
                                    <div class="row" id="Div_Operation" runat="server">
                                        <div class="col-xs-12">
                                            <div class="card">
                                                <div class="header">
                                                    <h3>
                                                        <%= Resources.Content.GN00001320%>                                                                                                                                 
                                                    </h3>
                                                </div>
                                                <div class="body">
                                                    <div class="row">
                                                        <div class="col-xs-12">
                                                            <asp:Button ID="Btn_SendCSPInvite" runat="server" class="btn btn-primary waves-effect btnAction" CausesValidation="false" Text="<%$ Resources:Content,strSendCSPInvite%>" />
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-xs-12 col-sm-5 col-md-3">
                                                            <label>
                                                                <asp:Literal ID="Literal12" runat="server" Text="<%$ Resources:Content,GN0000685%>" EnableViewState="false" />:
                                                            </label>
                                                            <div class="form-group display-date-input">
                                                                <div class="form-line">
                                                                    <asp:TextBox ID="TxBx_FromDate" runat="server"></asp:TextBox>
                                                                </div>
                                                            </div>
                                                            <i runat="server" id="A_FromDate" class="material-icons icon-calendar col-calendar"></i>
                                                            <EM:CalendarExtender ID="CE_FromDate" runat="server" TargetControlID="TxBx_FromDate"
                                                                Format="<%# System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern %>"
                                                                PopupButtonID="A_FromDate" CssClass="date__calendar">
                                                            </EM:CalendarExtender>
                                                        </div>
                                                        <div class="col-xs-12 col-sm-5 col-md-3">
                                                            <label>
                                                                <asp:Literal ID="Literal13" runat="server" Text="<%$ Resources:Content,GN0000690%>" EnableViewState="false" />:
                                                            </label>
                                                            <div class="form-group display-date-input">
                                                                <div class="form-line">
                                                                    <asp:TextBox ID="TxBx_ToDate" runat="server"></asp:TextBox>
                                                                </div>
                                                            </div>
                                                            <i runat="server" id="A_ToDate" class="material-icons icon-calendar col-calendar"></i>
                                                            <EM:CalendarExtender ID="CE_ToDate" runat="server" TargetControlID="TxBx_ToDate"
                                                                Format="<%# System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern %>"
                                                                PopupButtonID="A_ToDate" CssClass="date__calendar">
                                                            </EM:CalendarExtender>
                                                        </div>
                                                        <div class="col-xs-12 col-sm-2">
                                                            <asp:Button ID="Btn_ExportReconciliationReport" runat="server" class="btn btn-primary waves-effect" CausesValidation="false" Text="<%$ Resources:Content,ExportReconciliationReport%>" />
                                                        </div>
                                                    </div>

                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <%--Search box--%>
                                    <asp:Panel ID="Pnl_Btn_ApplyFilter" runat="server" CssClass="row" DefaultButton="Btn_ApplyFilter">
                                        <div class="panel-group search-panel" id="AS_O365Accounts" role="tablist" aria-multiselectable="true">
                                            <div class="col-xs-12" role="tab" id="SH_O365Accounts">
                                                <div class="card">
                                                    <div class="header" role="button" data-toggle="collapse" data-parent="#AS_O365Accounts" href="#<%= CSB_O365Accounts.ClientID%>" aria-expanded="true" aria-controls="SH_O365Accounts">
                                                        <h3>
                                                            <%= Resources.Content.GN0000395%>
                                                        </h3>
                                                    </div>
                                                    <div id="CSB_O365Accounts" runat="server" class="body panel-collapse collapse" role="tabpanel" aria-labelledby="SH_O365Accounts" aria-expanded="false">
                                                        <div class="row">

                                                            <div class="col-md-3 col-sm-6 col-xs-12" id="td_DDL_Owner" runat="server">
                                                                <div class="form-group form-float">
                                                                    <asp:DropDownList ID="DDL_Owner" runat="server" onchange="setOwnerCookie(this)">
                                                                    </asp:DropDownList>
                                                                </div>
                                                            </div>

                                                            <div class="col-md-3 col-sm-6 col-xs-12">
                                                                <div class="form-group form-float">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_TenantName" runat="server" MaxLength="200"></asp:TextBox>
                                                                        <asp:Label ID="Ltrl_TenantName" class="form-label" runat="server" Text="<%$ Resources:Content,TenantName %>"></asp:Label>
                                                                    </div>

                                                                </div>
                                                            </div>

                                                            <div class="col-md-3 col-sm-6 col-xs-12">
                                                                <div class="form-group form-float">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_SrchId" runat="server"></asp:TextBox>
                                                                        <asp:Label ID="Label1" runat="server" class="form-label" EnableViewState="false" Text="<%$ Resources:Content,SPT002807%>"></asp:Label>
                                                                    </div>

                                                                </div>
                                                            </div>

                                                            <div class="col-md-3 col-sm-6 col-xs-12">
                                                                <div class="form-group form-float">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_SrchDomainName" runat="server" MaxLength="200"></asp:TextBox>
                                                                        <asp:Label ID="Label2" runat="server" class="form-label" EnableViewState="false" Text="<%$ Resources:Content,GN0000653%>"></asp:Label>
                                                                    </div>

                                                                </div>
                                                            </div>

                                                            <div class="col-md-3 col-sm-6 col-xs-12">
                                                                <div class="form-group form-float">
                                                                    <asp:DropDownList ID="DDL_AccountStatus" runat="server"></asp:DropDownList>
                                                                </div>
                                                            </div>

                                                            <div class="col-md-3 col-sm-6 col-xs-12" id="td_DDL_CustomerId" runat="server">
                                                                <div class="form-group form-float">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_CustomerID" runat="server" />
                                                                        <asp:Label ID="Label3" runat="server" class="form-label" EnableViewState="false" Text="<%$ Resources:Content,GN0000715%>"></asp:Label>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="col-md-3 col-sm-6 col-xs-12" id="td_CustomerName" runat="server">
                                                                <div class="form-group form-float">

                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_CustomerName" runat="server" />
                                                                        <asp:Label ID="Label5" runat="server" class="form-label" EnableViewState="false" Text="<%$ Resources:Content,GN0000268%>"></asp:Label>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="col-md-3 col-sm-6 col-xs-12" id="td_CompanyNmae" runat="server">
                                                                <div class="form-group form-float">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_CompanyName" runat="server" />
                                                                        <asp:Label ID="Label6" runat="server" class="form-label" EnableViewState="false" Text="<%$ Resources:Content,GN00001077%>"></asp:Label>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="col-md-3 col-sm-6 col-xs-12">
                                                                <div class="form-group form-float">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_LabelSrch" runat="server"></asp:TextBox>
                                                                        <asp:Label ID="Label26" runat="server" EnableViewState="false" Text="<%$ Resources:Content,strLabel%>" class="form-label"></asp:Label>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="col-md-3 col-sm-6 col-xs-12">
                                                                <div class="form-group form-float">
                                                                    <asp:Button ID="Btn_ApplyFilter" class="btn btn-primary waves-effect" runat="server" Text="<%$ Resources:Content,GN0000391%>" />
                                                                    <asp:Button ID="Btn_ClearFilter" Visible="false" class="btn btn-primary waves-effect" runat="server" Text="<%$ Resources:Content,String289 %>" />

                                                                </div>
                                                            </div>

                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </asp:Panel>

                                    <div class="row">
                                        <div class="col-xs-12">
                                            <asp:GridView ID="GV_TenantsListing" CssClass="table table-bordered table-striped table-hover" AllowSorting="true" AllowPaging="true"
                                                EmptyDataText='<%$ Resources:Content, GN00001375 %>' runat="server" AutoGenerateColumns="False">
                                                <Columns>
                                                    <asp:TemplateField HeaderStyle-CssClass="col-xs-1" ItemStyle-CssClass="col-xs-1" HeaderText='<%$ Resources:Content, String385 %>'>
                                                        <ItemTemplate>
                                                            <asp:Label ID="lbl_Status" runat="server" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField SortExpression="ServiceHostingId" HeaderText="<%$ Resources:Content,DGN1119987%>" HeaderStyle-CssClass="col-xs-3" ItemStyle-CssClass="col-xs-3">
                                                        <ItemTemplate>
                                                            <%-- <asp:Literal ID="Literal19" runat="server" Text='<%$ Resources:Content, SPT002807 %>' />:                                                            
                                                            <asp:HyperLink ID="LB_SubID" runat="server">
                                                            </asp:HyperLink>
                                                            <br />
                                                            <asp:Literal ID="Literal25" runat="server" Text='<%$ Resources:Content, strLabel %>' />:   
                                                            <asp:Label ID="lbl_Label" runat="server" Text='<%#Eval("Label")%>' />
                                                            <br />
                                                            <asp:Literal ID="Literal27" runat="server" Text='<%$ Resources:Content, String490 %>' />: 
                                                             <asp:Literal ID="Ltrl_PackageName" runat="server" Text='<%# Eval("PackageName")%>' />--%>

                                                            <table class="table small">
                                                                <tbody>

                                                                    <tr>
                                                                        <td class="col-xs-5 row-label">
                                                                            <asp:Label ID="Label1" runat="server" Text="<%$ Resources:Content,SPT002807%>" EnableViewState="false"></asp:Label>:                                                            
                                                                        </td>
                                                                        <td class="col-xs-8">
                                                                            <asp:HyperLink ID="LB_SubID" runat="server"></asp:HyperLink>
                                                                        </td>
                                                                    </tr>

                                                                    <tr>
                                                                        <td class="col-xs-5 row-label">
                                                                            <asp:Label ID="Label2" runat="server" Text="<%$ Resources:Content,GN000141%>" EnableViewState="false"></asp:Label>:                                                          
                                                                        </td>
                                                                        <td class="col-xs-8">
                                                                            <asp:Label ID="LB_PackageName" runat="server" Text='<%#DataBinder.Eval(Container, "DataItem.PackageName")%>'></asp:Label>
                                                                        </td>
                                                                    </tr>

                                                                    <tr id="trLabel" runat="server">
                                                                        <td class="col-xs-5 row-label">
                                                                            <asp:Label ID="lbl_LabelColon" runat="server" Text="<%$ Resources:Content,StrLabelColon%>" EnableViewState="false"></asp:Label>
                                                                        </td>
                                                                        <td class="col-xs-8">
                                                                            <asp:Label ID="Label27" runat="server" Text='<%#DataBinder.Eval(Container, "DataItem.Label")%>'></asp:Label>
                                                                        </td>
                                                                    </tr>

                                                                </tbody>
                                                            </table>

                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <%-- <asp:TemplateField HeaderText='<%$ Resources:Content, String490 %>' HeaderStyle-CssClass="col-xs-2 hidden-xs" ItemStyle-CssClass="col-xs-2 hidden-xs">
                                                        <ItemTemplate>
                                                            <asp:Literal ID="Ltrl_PackageName" runat="server" Text='<%# Eval("PackageName")%>' />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>--%>

                                                    <asp:TemplateField HeaderText='<%$ Resources:Content, GN0000850 %>' SortExpression="CustomerId" HeaderStyle-CssClass="col-xs-1" ItemStyle-CssClass="col-xs-1">
                                                        <ItemTemplate>
                                                            <asp:HyperLink ID="HL_CustomerId" runat="server" />
                                                            <%--NavigateUrl='<%# ResolveUrl("~/RCC/Clients/ClientDetail.aspx?CID=") & Eval("CustomerId").ToString()%>'--%>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>


                                                    <asp:TemplateField HeaderText='<%$ Resources:Content, TenantId %>' HeaderStyle-CssClass="col-xs-1" ItemStyle-CssClass="col-xs-1" SortExpression="TenantId" Visible="false">
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="LB_TenantID" runat="server" Text='<%#Eval("TenantId")%>' CommandName="ViewDetail"
                                                                CommandArgument='<%# Eval("TenantId")%>' />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText='<%$ Resources:Content, TenantName %>' SortExpression="TenantName" HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                                                        <ItemTemplate>
                                                            <asp:Literal ID="Literal9" runat="server" Text='<%$ Resources:Content, strTenant %>' />:
                                                            <asp:Literal ID="Ltrl_TenantName" runat="server" Text='<%# Eval("TenantName")%>' />
                                                            <br />
                                                            <asp:Literal ID="Literal10" runat="server" Text='<%$ Resources:Content, GN0000653 %>' />:
                                                            <asp:Literal ID="Ltrl_Domain" runat="server" Text='<%# Eval("DomainName")%>' />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <%-- <asp:TemplateField HeaderText='<%$ Resources:Content, GN0000653 %>' SortExpression="Domain" HeaderStyle-Width="100px">
                                                                    <ItemTemplate>
                                                                        
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>--%>

                                                    <%-- <asp:TemplateField HeaderText='<%$ Resources:Content, GN00001077 %>' SortExpression="CustomerCompanyName" HeaderStyle-Width="100px">
                                                                    <ItemTemplate>
                                                                        <asp:Literal ID="Ltrl_CustomerCompanyName" runat="server" Text='<%# Eval("CustomerCompanyName")%>' />
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>--%>

                                                    <asp:TemplateField HeaderText='<%$ Resources:Content, SPT002811 %>' SortExpression="Owner" HeaderStyle-CssClass="col-xs-1" ItemStyle-CssClass="col-xs-1">
                                                        <ItemTemplate>
                                                            <asp:HyperLink ID="Ltrl_CustomerOwner" runat="server" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText='<%$ Resources:Content, GN0000360 %>' HeaderStyle-CssClass="col-xs-1" ItemStyle-CssClass="col-xs-1">
                                                        <ItemTemplate>
                                                            <%--<ul class="option-menu" id="ul_options" runat="server">
                                                                <li class="dropdown">
                                                                    <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                                                                        <i class="material-icons">menu</i>
                                                                    </a>
                                                                    <ul class="dropdown-menu pull-right">
                                                                        <li>--%>
                                                            <asp:HyperLink CssClass="btn btn-primary waves-effect" ID="HL_TenantDetail" runat="server" Text="<%$ Resources:Content,L0086 %>"
                                                                NavigateUrl='<%# ResolveUrl("~/RCC/O365/TenantDetail.aspx?TId=") & Eval("TenantId").ToString()%>'></asp:HyperLink>
                                                            <%--</li>
                                                                        <li>--%>
                                                            <asp:LinkButton CssClass="btn btn-primary waves-effect" ID="Lbtn_Edit" runat="server" Text="<%$ Resources:Content,GN0000276%>"
                                                                CommandName="EditTenant" CommandArgument='<%# Eval("TenantId")%>' Visible="false"></asp:LinkButton>
                                                            <%--</li>
                                                                        <li>--%>
                                                            <asp:LinkButton CssClass="btn btn-primary waves-effect btnAction" ID="LB_Remove" runat="server" Text="<%$ Resources:Content,GN0000278%>"
                                                                CommandName="RemoveTenant"></asp:LinkButton>
                                                            <%--</li>
                                                                    </ul>
                                                                </li>
                                                            </ul>--%>
                                                            <EM:ConfirmButtonExtender ID="CBE_Remove" ConfirmText="<%$ Resources:Content,GN000200%>"
                                                                TargetControlID="LB_Remove" runat="server">
                                                            </EM:ConfirmButtonExtender>

                                                            <%-- </asp:Panel>
                                                                </div>--%>
                                                        </ItemTemplate>


                                                    </asp:TemplateField>
                                                </Columns>
                                                <%--PagerTemplate Start--%>
                                                <PagerTemplate>
                                                    <UC:Pager ID="Pager1" runat="server" />
                                                </PagerTemplate>
                                                <%--PagerTemplate End--%>
                                            </asp:GridView>
                                        </div>
                                    </div>
                                </asp:Panel>

                                <asp:Panel ID="Pnl_SendCSPInvite" runat="server" Visible="false" DefaultButton="Btn_SaveCSPInvite">
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <div class="card">
                                                <div class="header">
                                                    <h3>
                                                        <%= Resources.Content.strSendCSPInvite%>                                                                                                                                 
                                                    </h3>
                                                </div>
                                                <div class="body">
                                                    <div class="row">
                                                        <div class="col-sm-3 col-xs-12 row-label">
                                                            <label>
                                                                <asp:Literal ID="Ltl_Owner" runat="server" Text="<%$ Resources:Content,GN0000372 %>"></asp:Literal>:</label>
                                                        </div>
                                                        <div class="col-sm-4 col-xs-12">
                                                            <div class="form-group">
                                                                <asp:DropDownList ID="DDL_FromOwner" runat="server" AutoPostBack="true" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div id="Div_SendCSPInviteOptions" runat="server" visible="false">
                                                        <div class="row">
                                                            <div class="col-sm-3 col-xs-12 row-label">
                                                                <label>
                                                                    *<asp:Literal ID="Literal1" runat="server" Text="<%$ Resources:Content,FAM0023 %>"></asp:Literal>:</label>
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:DropDownList ID="DDL_Locale" runat="server" AutoPostBack="true" />
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-3 col-xs-12 row-label">
                                                                <label>
                                                                    *<asp:Literal ID="Literal3" runat="server" Text="<%$ Resources:Content,strSelectCSPProfile %>"></asp:Literal>:</label>
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:DropDownList ID="DDL_CSPProfiles" runat="server" AutoPostBack="true" />
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-3 col-xs-12 row-label">
                                                                <label>
                                                                    *<asp:Literal ID="Literal4" runat="server" Text="<%$ Resources:Content,strInvitationLink %>"></asp:Literal>:</label>
                                                            </div>
                                                            <div class="col-sm-9 col-xs-12">
                                                                <div class="form-group">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_InvitationLink" runat="server" Text="https://portal.office.com/partner/partnersignup.aspx?type=ResellerRelationship&csp=1&id=ReplaceProfileIdHere&msppid=0" />
                                                                    </div>
                                                                </div>
                                                                <asp:RequiredFieldValidator ID="RFV_TxBx_InvitationLink" runat="server" ControlToValidate="TxBx_InvitationLink"
                                                                    Display="None" SetFocusOnError="True" ValidationGroup="SendCSPInvite"></asp:RequiredFieldValidator>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-3 col-xs-12 row-label">
                                                                <label>
                                                                    *<asp:Literal ID="Literal5" runat="server" Text="<%$ Resources:Content,OCS016 %>"></asp:Literal>:</label>
                                                            </div>
                                                            <div class="col-sm-9 col-xs-12">
                                                                <div class="form-group">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_To" runat="server" />
                                                                    </div>
                                                                </div>
                                                                <asp:RequiredFieldValidator ID="RFV_TxBx_To" runat="server" ControlToValidate="TxBx_To"
                                                                    Display="None" SetFocusOnError="True" ValidationGroup="SendCSPInvite"></asp:RequiredFieldValidator>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-3 col-xs-12 row-label">
                                                                <label>
                                                                    <asp:Literal ID="Literal6" runat="server" Text="<%$ Resources:Content,GN00001340 %>"></asp:Literal>:</label>
                                                            </div>
                                                            <div class="col-sm-9 col-xs-12">
                                                                <div class="form-group">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_CC" runat="server" />
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-3 col-xs-12 row-label">
                                                                <label>
                                                                    *<asp:Literal ID="Literal7" runat="server" Text="<%$ Resources:Content,GN0000371 %>"></asp:Literal>:</label>
                                                            </div>
                                                            <div class="col-sm-9 col-xs-12">
                                                                <div class="form-group">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_Subject" runat="server" Text="<%$ Resources:Content,strCSPAuthRequest %>" />
                                                                    </div>
                                                                </div>
                                                                <asp:RequiredFieldValidator ID="RFV_TxBx_Subject" runat="server" ControlToValidate="TxBx_Subject"
                                                                    Display="None" SetFocusOnError="True" ValidationGroup="SendCSPInvite"></asp:RequiredFieldValidator>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-xs-12 row-label">
                                                                <label>
                                                                    *<asp:Literal ID="Literal8" runat="server" Text="<%$ Resources:Content,GN0000541 %>"></asp:Literal>:</label>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-xs-12">
                                                                <obout:Editor ID="Editor_Body" Submit="false" ShowWaitMessage="false" AjaxWait="false" runat="server" Appearance="custom">
                                                                    <Buttons>
                                                                        <obout:Select Name="FontName" />
                                                                        <obout:Select Name="FontSize" />
                                                                        <obout:HorizontalSeparator />
                                                                        <obout:Toggle Name="Bold" />
                                                                        <obout:Toggle Name="Italic" />
                                                                        <obout:Toggle Name="Underline" />
                                                                        <obout:Toggle Name="StrikeThrough" />
                                                                        <obout:Toggle Name="SuperScript" />
                                                                        <obout:Toggle Name="SubScript" />
                                                                        <obout:HorizontalSeparator />
                                                                        <obout:Method Name="ForeColor" />
                                                                        <obout:Method Name="ForeColorClear" />
                                                                        <obout:Method Name="BackColor" />
                                                                        <obout:Method Name="BackColorClear" />
                                                                        <obout:VerticalSeparator />
                                                                        <obout:Method Name="Redo" />
                                                                        <obout:Method Name="Undo" />
                                                                        <obout:HorizontalSeparator />
                                                                        <obout:Method Name="Cut" />
                                                                        <obout:Method Name="Copy" />
                                                                        <obout:Method Name="Paste" />
                                                                        <obout:Method Name="PasteText" />
                                                                        <obout:HorizontalSeparator />
                                                                        <obout:Method Name="Paragraph" />
                                                                        <obout:Method Name="GetFormat" />
                                                                        <obout:Method Name="ApplyFormat" />
                                                                        <obout:HorizontalSeparator />
                                                                        <obout:Method Name="JustifyLeft" />
                                                                        <obout:Method Name="JustifyCenter" />
                                                                        <obout:Method Name="JustifyRight" />
                                                                        <obout:Method Name="JustifyFull" />
                                                                        <obout:HorizontalSeparator />
                                                                        <obout:Method Name="OrderedList" />
                                                                        <obout:Method Name="BulletedList" />
                                                                        <obout:HorizontalSeparator />
                                                                        <obout:Method Name="InsertHR" />
                                                                        <obout:Method Name="CreateLink" />
                                                                        <obout:Method Name="InsertAnchor" />
                                                                        <obout:Method Name="InsertIMG" />
                                                                        <obout:HorizontalSeparator />
                                                                        <obout:Method Name="ClearStyles" />
                                                                    </Buttons>
                                                                </obout:Editor>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-xs-12">
                                                            <asp:ValidationSummary ID="VS" runat="server" ShowMessageBox="true" ShowSummary="false"
                                                                ValidationGroup="SendCSPInvite" HeaderText="<%$ Resources:Content,EM000001%>" />

                                                            <asp:Button ID="Btn_SaveCSPInvite" runat="server" Visible="false" class="btn btn-primary waves-effect btnAction" ValidationGroup="SendCSPInvite" Text="<%$ Resources:Content,Save%>" />
                                                            <asp:Button ID="Btn_CancelCSPInvite" runat="server" class="btn btn-primary waves-effect" CausesValidation="false" Text="<%$ Resources:Content,GN0000572%>" />
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </asp:Panel>
                            </asp:Panel>
                        </ContentTemplate>
                    </EM:TabPanel>

                    <EM:TabPanel ID="Tab_TenantsDetail" runat="server" Enabled="false" HeaderText="<%$ Resources:Content,TenantDetail %>">
                        <ContentTemplate>
                            <asp:Button ID="Btn_Tab1" runat="server" Style="display: none;" />
                            <asp:Panel ID="Pnl_TabContent1" runat="server" Visible="false">
                                <asp:HiddenField ID="HF_TenantId" runat="server" />
                                <div class="card">
                                    <div class="header">
                                        <div class="displayInlineBlock">
                                            <h3>
                                                <asp:Literal ID="Literal2" runat="server" Text='<%$ Resources:Content,TenantDetail%>' EnableViewState="false" />
                                            </h3>
                                        </div>
                                        <asp:Button ID="Btn_GoBack" CssClass="btn btn-primary waves-effect pull-right m-t--4px" CausesValidation="false" runat="server" Text="<%$ Resources:Content, String1018 %>" />
                                    </div>
                                    <div class="body">
                                        <div class="row" id="tr_selectOwner" runat="server">
                                            <div class="col-sm-3 col-xs-12 row-label">
                                                <asp:Literal ID="Ltrl_SelectOwner" runat="server" Text="<%$ Resources:Content,L00108%>"></asp:Literal>:
                                            </div>
                                            <div class="col-sm-4 col-xs-12">
                                                <asp:DropDownList ID="Ddl_Selectowner" runat="server" Width="90%" AutoPostBack="true">
                                                </asp:DropDownList>
                                            </div>
                                        </div>

                                        <div class="row" id="tr_selectCustomer" runat="server">
                                            <div class="col-sm-3 col-xs-12 row-label">
                                                <asp:Literal ID="Ltrl_SelectCustomer" runat="server" Text="<%$ Resources:Content,GN0000889%>"></asp:Literal>:
                                            </div>
                                            <div class="col-sm-4 col-xs-12">
                                                <asp:DropDownList ID="Ddl_SelectCustomer" runat="server" Width="90%"></asp:DropDownList>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-sm-3 col-xs-12 row-label">
                                                *
                                <asp:Literal ID="Ltrl_InputTenantName" runat="server" Text="<%$ Resources:Content,TenantName%>"></asp:Literal>:
                                            </div>
                                            <div class="col-sm-4 col-xs-12">
                                                <div class="form-group">
                                                    <div class="form-line">
                                                        <asp:TextBox ID="TxBx_InputTenantName" runat="server" MaxLength="200"
                                                            ValidationGroup="SaveTenantInfo" CausesValidation="true"></asp:TextBox>
                                                    </div>
                                                </div>
                                                <asp:RequiredFieldValidator ID="RFV_InputTenantName" runat="server" ControlToValidate="TxBx_InputTenantName"
                                                    Display="None" SetFocusOnError="true"
                                                    ValidationGroup="SaveTenantInfo"></asp:RequiredFieldValidator>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-sm-3 col-xs-12 row-label">
                                                *
                                            <asp:Literal ID="Ltrl_InputTenantLogin" runat="server" Text="<%$ Resources:Content,GN00001114%>"></asp:Literal>:
                                            </div>
                                            <div class="col-sm-4 col-xs-12">
                                                <div class="form-group">
                                                    <div class="form-line">
                                                        <asp:TextBox ID="TxBx_InputTenantLogin" runat="server" MaxLength="200"
                                                            ValidationGroup="SaveTenantInfo" CausesValidation="true"></asp:TextBox>
                                                    </div>
                                                </div>
                                                <asp:RequiredFieldValidator ID="RFV_InputTenantLogin" runat="server" ControlToValidate="TxBx_InputTenantLogin"
                                                    Display="None" SetFocusOnError="true"
                                                    ValidationGroup="SaveTenantInfo"></asp:RequiredFieldValidator>
                                            </div>
                                        </div>


                                        <div class="row" id="tr_managesponline" runat="server">
                                            <div class="col-sm-3 col-xs-12 row-label">
                                                <asp:Literal ID="Literal24" runat="server" Text="<%$ Resources:Content,StrManageSharepointOnline%>"></asp:Literal>:

                                            </div>
                                            <div class="col-sm-4 col-xs-12 m-t-5">
                                                <asp:CheckBox ID="CB_ManageSharepointOnline" runat="server" Text=" " onChange="ManageSPOChangeHandler(event.target)" />
                                            </div>
                                        </div>
                                        <script type="text/javascript">
                                            function ManageSPOChangeHandler(source) {

                                                try {
                                                    if (!source)
                                                        $('div[id$="tr_password"]').hide();
                                                    if (source.checked)
                                                        $('div[id$="tr_password"]').show();
                                                    else
                                                        $('div[id$="tr_password"]').hide();
                                                } catch{ }
                                            }
                                            $(function () {
                                                setTimeout(function () { ManageSPOChangeHandler($('input[id$="CB_ManageSharepointOnline"]').get(0)); }, 1000);
                                            })
                                        </script>
                                        <div class="row" id="tr_password" runat="server">
                                            <div class="col-sm-3 col-xs-12 row-label">
                                                *
                                                        <asp:Literal ID="Ltrl_InputTenantPswrd" runat="server" Text="<%$ Resources:Content,StrAppPassword%>"></asp:Literal>:

                                            </div>
                                            <div class="col-sm-4 col-xs-12">
                                                <div class="form-group">
                                                    <div class="form-line">
                                                        <asp:TextBox ID="TxBx_InputTenantPswrd" runat="server" MaxLength="50"
                                                            TextMode="Password" ValidationGroup="SaveTenantInfo" CausesValidation="true"></asp:TextBox>
                                                    </div>
                                                </div>
                                                <asp:Literal ID="Ltl_LeaveBlank" runat="server" Text="<%$ Resources:Content,GN00001530 %>"
                                                    Visible="false"></asp:Literal>
                                                <asp:RequiredFieldValidator ID="RFV_InputTenantPswrd" runat="server" ControlToValidate="TxBx_InputTenantPswrd"
                                                    Display="None" SetFocusOnError="true"
                                                    ValidationGroup="SaveTenantInfo">
                                                </asp:RequiredFieldValidator>
                                            </div>
                                            <div class="col-sm-4 col-xs-12 row-label">
                                                <asp:Literal ID="Ltrl_AppPasswordNote" runat="server" Text="<%$ Resources:Content,TenantMFAAppPasswordNote %>"></asp:Literal>
                                            </div>
                                        </div>

                                        <div class="row" id="tr_selectCountry" runat="server">
                                            <div class="col-sm-3 col-xs-12 row-label">
                                                <asp:Literal ID="Ltl_selectCountry" runat="server" Text="<%$ Resources:Content,GN0000882%>"></asp:Literal>:
                                            </div>
                                            <div class="col-sm-4 col-xs-12">
                                                <asp:DropDownList ID="DDL_selectCountry" runat="server">
                                                </asp:DropDownList>
                                            </div>
                                        </div>

                                        <div class="row" id="tr_selectLocale" runat="server">
                                            <div class="col-sm-3 col-xs-12 row-label">
                                                <asp:Literal ID="Ltl_selectLocale" runat="server" Text="<%$ Resources:Content,FAM0023%>"></asp:Literal>:
                                            </div>
                                            <div class="col-sm-4 col-xs-12">
                                                <asp:DropDownList ID="DDL_selectLocale" runat="server" Width="90%">
                                                </asp:DropDownList>
                                            </div>
                                        </div>
                                        <div class="row m-t-10">
                                            <div class="col-lg-9 col-md-9 col-sm-offset-3 col-sm-9 col-xs-12">
                                                <a href="javascript:void(0)" id="Lbtn_GrantAdminConsent" runat="server" class="btn btn-primary waves-effect" style="margin-top: -10px;">
                                                    <b>
                                                        <asp:Literal ID="Ltrl_StrTenantManagementConsentButton" runat="server" Text='<%$Resources:Content, StrTenantManagementConsentButton %>' /></b>
                                                </a>
                                            </div>

                                            <%--<div class="col-lg-7 col-md-6 col-md-offset-0 col-sm-offset-3 col-sm-9 col-xs-12 m-t--10">
                                                <i id="grant_info_icon" class="glyphicon glyphicon-info-sign gi-1_75x"></i>
                                                <b>

                                                    <%--<asp:Literal ID="Literal25" runat="server" Text="<% $Resources:Content, Note%>"></asp:Literal>:--%>
                                            <%--<asp:Literal ID="Ltrl_GrantConsentNote" runat="server" Text="<% $Resources:Content, StrO365ConsentHelpContent%>"></asp:Literal>
                                                </b>
                                            </div>--%>
                                        </div>
                                        <%--<div class="row">
                                            <div class="col-sm-3"></div>
                                            <div class="col-sm-9 col-xs-12">
                                                <asp:ValidationSummary ID="VS_SaveTenantInfo" runat="server" HeaderText='<%$ Resources:Content,EM000001%>'
                                                    DisplayMode="List" ShowMessageBox="true" ShowSummary="false" ValidationGroup="SaveTenantInfo" />

                                                <asp:Button ID="Btn_SaveTenantInfo" class="btn btn-primary waves-effect" runat="server" Text='<%$ Resources:Content,GN0000281 %>'
                                                    CausesValidation="true" ValidationGroup="SaveTenantInfo" />

                                                <asp:Button ID="Btn_CancelSave" class="btn btn-primary waves-effect" runat="server" Text='<%$ Resources:Content,GN0000572 %>'
                                                    CausesValidation="false" />
                                            </div>
                                        </div>--%>
                                    </div>
                                </div>
                            </asp:Panel>
                        </ContentTemplate>
                    </EM:TabPanel>

                    <EM:TabPanel ID="Tab_Settings" runat="server" HeaderText="<%$ Resources:Content,M0027 %>">
                        <ContentTemplate>
                            <asp:Button ID="Btn_Tab2" runat="server" Style="display: none;" />
                            <asp:Panel ID="Pnl_TabContent2" runat="server" DefaultButton="Btn_SaveSettings" Visible="false">
                                <div class="card">
                                    <%--<div class="header">
                                        <h3>
                                            <asp:Literal ID="Literal11" runat="server" Text='<%$ Resources:Content,M0027%>' EnableViewState="false" />
                                        </h3>
                                    </div>--%>
                                    <div class="body">
                                        <div class="row">
                                            <div class="col-sm-3 col-xs-12 row-label">
                                                <asp:Literal ID="Literal16" runat="server" Text="<%$ Resources:Content,AllowSPManagement%>"></asp:Literal>:
                                            </div>
                                            <div class="col-sm-4 col-xs-12">
                                                <div class="form-group">
                                                    <asp:CheckBox ID="CB_O365SPManage" runat="server" Text=" "></asp:CheckBox>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-xs-12">
                                                <asp:Button ID="Btn_SaveSettings" class="btn btn-primary waves-effect btnAction" runat="server" Text='<%$ Resources:Content,GN0000281 %>'
                                                    CausesValidation="false" />
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </asp:Panel>
                        </ContentTemplate>
                    </EM:TabPanel>

                    <EM:TabPanel ID="Tab_PhoneNumberManagement" runat="server" HeaderText="<%$ Resources:Content,PNManagement %>">
                        <ContentTemplate>
                            <asp:Button ID="Btn_Tab3" runat="server" Style="display: none;" />
                            <asp:Panel ID="Pnl_TabContent3" runat="server" Visible="false">
                                <div class="products-step">
                                    <span id="div_s5" runat="server" nowrap="true" class="label label-success">
                                        <asp:LinkButton ID="Lb_PhoneNumbers" runat="server" Text='<%$ Resources:Content, Dev1089 %>' />
                                    </span>
                                    <span id="div_s6" runat="server" nowrap="true" class="label label-default">
                                        <asp:LinkButton ID="Lb_PhoneGroups" runat="server" Text='<%$ Resources:Content, Lync302 %>' />
                                    </span>
                                </div>
                                <div class="col-xs-12"></div>
                                <asp:Panel ID="Pnl_PhoneNumbers" runat="server">
                                    <%-- Phone Numbers Listing --%>
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <%-- Operations --%>
                                            <div class="row Div_OpsRow" id="Div_OpsRow" runat="server">
                                                <div class="col-xs-12">
                                                    <div class="card">
                                                        <div class="header">
                                                            <h3>
                                                                <%= Resources.Content.GN00001320%>                                                                                                                                 
                                                            </h3>
                                                        </div>
                                                        <div class="body">
                                                            <div class="row">
                                                                <div class="col-xs-12">
                                                                    <asp:Button ID="Btn_AddPhoneNumber" class="btn btn-primary waves-effect btnAction" runat="server" Text='<%$ Resources:Content,OCS002 %>' />
                                                                    <asp:Button ID="Btn_RemoveSelectedNumbers" runat="server" Custom1="Custom" Style="display: none" Text="<%$ Resources:Content,GN0000278%>" CssClass="btn btn-primary waves-effect btnAction" />
                                                                    <EM:ConfirmButtonExtender ID="CBE_RemoveSelectedNumbers" ConfirmText="<%$ Resources:Content,DGN1119974%>" TargetControlID="Btn_RemoveSelectedNumbers" runat="server">
                                                                    </EM:ConfirmButtonExtender>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <%-- Search Panel --%>
                                            <asp:Panel ID="Panel1" runat="server" CssClass="row" DefaultButton="Btn_ApplyFilter_PhoneNumbers">
                                                <div class="panel-group search-panel" id="AS_PhoneNumbers" role="tablist" aria-multiselectable="true">
                                                    <div class="col-xs-12" role="tab" id="SH_PhoneNumbers">

                                                        <div class="card">
                                                            <div class="header" role="button" data-toggle="collapse" data-parent="#AS_PhoneNumbers" href="#<%= CSB_PhoneNumbers.ClientID%>" aria-expanded="true" aria-controls="SH_PhoneNumbers">
                                                                <h3>
                                                                    <%= Resources.Content.GN0000395%>
                                                                </h3>
                                                            </div>

                                                            <div id="CSB_PhoneNumbers" runat="server" class="body panel-collapse collapse" role="tabpanel" aria-labelledby="SH_PhoneNumbers" aria-expanded="false">
                                                                <div class="row">
                                                                    <div class="col-md-3 col-sm-6 col-xs-12">
                                                                        <div class="form-group form-float">
                                                                            <asp:DropDownList ID="DDL_OwnerPhoneNumberFilter" runat="server" onchange="setOwnerCookie(this)">
                                                                            </asp:DropDownList>
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-md-3 col-sm-6 col-xs-12">
                                                                        <div class="form-group form-float">
                                                                            <div class="form-line">
                                                                                <asp:TextBox ID="TxBx_SrchPhoneNumber" runat="server" CssClass="allowonlyintegervalues" MaxLength="19"></asp:TextBox>
                                                                                <asp:Label ID="Label4" runat="server" class="form-label" EnableViewState="false" Text="<%$ Resources:Content,PhoneNumber%>"></asp:Label>
                                                                            </div>

                                                                        </div>
                                                                        <asp:RangeValidator ID="RV_TxBx_SrchPhoneNumber" runat="server" ControlToValidate="TxBx_SrchPhoneNumber"
                                                                            Display="None" SetFocusOnError="true" ValidationGroup="SearchPhoneNumbers"
                                                                            ErrorMessage="<%$ Resources:Content,DGN1110070 %>" Type="Double"
                                                                            MinimumValue="0" MaximumValue="9223372036854775807"></asp:RangeValidator>
                                                                    </div>
                                                                    <div class="col-md-3 col-sm-6 col-xs-12">
                                                                        <div class="form-group form-float">
                                                                            <div class="form-line">
                                                                                <asp:TextBox ID="TxBx_SearchAssignTo" runat="server" MaxLength="19"></asp:TextBox>
                                                                                <asp:Label ID="Label7" runat="server" class="form-label" EnableViewState="false" Text="<%$ Resources:Content,DEV1133%>"></asp:Label>
                                                                            </div>

                                                                        </div>
                                                                    </div>

                                                                    <div class="col-md-3 col-sm-6 col-xs-12">
                                                                        <div class="form-group form-float">
                                                                            <div class="form-line">
                                                                                <asp:TextBox ID="TxBx_TenantNamePhoneNumberFilter" runat="server" MaxLength="200"></asp:TextBox>
                                                                                <asp:Label ID="Label9" class="form-label" runat="server" Text="<%$ Resources:Content,TenantName %>"></asp:Label>
                                                                            </div>

                                                                        </div>
                                                                    </div>

                                                                    <div class="col-md-3 col-sm-6 col-xs-12">
                                                                        <div class="form-group form-float">
                                                                            <div class="form-line">
                                                                                <asp:TextBox ID="TxBx_CustomerIDPhoneNumberFilter" runat="server" />
                                                                                <asp:Label ID="Label10" runat="server" class="form-label" EnableViewState="false" Text="<%$ Resources:Content,GN0000715%>"></asp:Label>
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="col-md-3 col-sm-6 col-xs-12">
                                                                        <div class="form-group form-float">

                                                                            <div class="form-line">
                                                                                <asp:TextBox ID="TxBx_CustomerNamePhoneNumberFilter" runat="server" />
                                                                                <asp:Label ID="Label11" runat="server" class="form-label" EnableViewState="false" Text="<%$ Resources:Content,GN0000268%>"></asp:Label>
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="col-md-3 col-sm-6 col-xs-12">
                                                                        <div class="form-group form-float">
                                                                            <div class="form-line">
                                                                                <asp:TextBox ID="TxBx_CompanyNamePhoneNumberFilter" runat="server" />
                                                                                <asp:Label ID="Label12" runat="server" class="form-label" EnableViewState="false" Text="<%$ Resources:Content,StrCustomerCompanyName%>"></asp:Label>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-xs-12">
                                                                        <div class="form-group form-float">
                                                                            <asp:ValidationSummary ID="VS_SearchPhoneNumbers" runat="server" ShowMessageBox="true"
                                                                                ShowSummary="false" ValidationGroup="SearchPhoneNumbers" />
                                                                            <asp:Button ID="Btn_ApplyFilter_PhoneNumbers" ValidationGroup="SearchPhoneNumbers" class="btn btn-primary waves-effect" runat="server" Text="<%$ Resources:Content,GN0000391%>" />
                                                                            <asp:Button ID="Btn_ClearFilter_PhoneNumbers" class="btn btn-primary waves-effect" Visible="false" runat="server" Text="<%$ Resources:Content,String289 %>" />

                                                                        </div>
                                                                    </div>

                                                                </div>
                                                            </div>
                                                        </div>

                                                    </div>
                                                </div>
                                            </asp:Panel>
                                            <EM:MPGridView ID="GV_PhoneNumbersListing" CssClass="table table-bordered table-striped table-hover" AllowSorting="true" AllowPaging="true" EmptyDataText='<%$ Resources:Content, GN00001375 %>' runat="server" AutoGenerateColumns="False">
                                                <Columns>
                                                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-CssClass="col-xs-1" HeaderText='<%$ Resources:Content,GN0000370 %>'>
                                                        <HeaderTemplate>
                                                            <asp:CheckBox class="option-menu" ID="ChkBx_All" runat="server" Text=" " onclick="SetCheckedHeader(this.checked, this,'All');" />
                                                        </HeaderTemplate>
                                                        <ItemTemplate>
                                                            <asp:CheckBox class="option-menu" ID="ChkBx_Item" onclick="SetCheckedHeader(this.checked, this,'1');" Text="&nbsp;" runat="server"></asp:CheckBox>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField SortExpression="PhoneNumber" HeaderText='<%$ Resources:Content, PhoneNumber %>'>
                                                        <ItemTemplate>
                                                            <asp:Label ID="LB_PhoneNumber" runat="server" Text="" />
                                                            <asp:HiddenField ID="Hf_TenantId" runat="server" Value='<%# DataBinder.Eval(Container, "DataItem.TenantId") %>' />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField SortExpression="TenantName" HeaderText="<%$ Resources:Content,TenantName%>" HeaderStyle-CssClass="col-xs-3">
                                                        <ItemTemplate>
                                                            <asp:HyperLink ID="Hl_TenantName" runat="server"></asp:HyperLink>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="<%$ Resources:Content,DEV1133%>" HeaderStyle-CssClass="col-xs-3">
                                                        <ItemTemplate>
                                                            <asp:Label ID="LB_AssignedTo" runat="server" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText='<%$ Resources:Content, GN0000360 %>' HeaderStyle-CssClass="col-xs-2">
                                                        <ItemTemplate>
                                                            <asp:Button ID="Btn_RemoveFreePhone" runat="server" Text="<%$ Resources:Content,strRemove %>"
                                                                CssClass="btn btn-primary waves-effect btnAction" CommandName="RemoveFreePhone" />

                                                            <EM:ConfirmButtonExtender ID="CBE_RemoveFreePhone" runat="server" ConfirmText="<%$Resources:Content,strRemoveConfirmation%>"
                                                                TargetControlID="Btn_RemoveFreePhone">
                                                            </EM:ConfirmButtonExtender>

                                                        </ItemTemplate>

                                                    </asp:TemplateField>
                                                </Columns>
                                                <PagerTemplate>
                                                    <UC:Pager ID="Pager" runat="server" />
                                                </PagerTemplate>
                                            </EM:MPGridView>
                                        </div>
                                    </div>
                                </asp:Panel>

                                <asp:Panel ID="Pnl_PhoneGroups" runat="server">
                                    <%-- Operations --%>
                                    <div class="row Div_OpsRow" id="Div_OpsRow2" runat="server">
                                        <div class="col-xs-12">
                                            <div class="card">
                                                <div class="header">
                                                    <h3>
                                                        <%= Resources.Content.GN00001320%>                                                                                                                                 
                                                    </h3>
                                                </div>
                                                <div class="body">
                                                    <div class="row">
                                                        <div class="col-xs-12">
                                                            <asp:Button ID="Btn_AddPhoneGroup" class="btn btn-primary waves-effect btnAction" runat="server"
                                                                Text='<%$ Resources:Content,DEV1116%>' />
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <%-- Search --%>
                                    <asp:Panel ID="Pnl_Search" runat="server" CssClass="row" DefaultButton="Btn_FilterGroup">
                                        <div class="panel-group search-panel" id="AS_PhoneGroups" role="tablist" aria-multiselectable="true">
                                            <div class="col-xs-12" role="tab" id="SH_PhoneGroups">
                                                <div class="card">
                                                    <div class="header" role="button" data-toggle="collapse" data-parent="#AS_PhoneGroups" href="#<%= CSB_PhoneGroups.ClientID%>" aria-expanded="true" aria-controls="SH_PhoneGroups">
                                                        <h3>
                                                            <%= Resources.Content.GN0000395%>
                                                        </h3>
                                                    </div>
                                                    <div id="CSB_PhoneGroups" runat="server" class="body panel-collapse collapse" role="tabpanel" aria-labelledby="SH_PhoneGroups" aria-expanded="false">
                                                        <div class="row">
                                                            <div class="col-sm-3 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:DropDownList ID="Ddl_OwnerGroupFilter" runat="server">
                                                                    </asp:DropDownList>
                                                                </div>
                                                            </div>

                                                            <div class="col-md-3 col-sm-6 col-xs-12">
                                                                <div class="form-group form-float">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_CustomerIDGroupFilter" runat="server" />
                                                                        <asp:Label ID="Label13" runat="server" class="form-label" EnableViewState="false" Text="<%$ Resources:Content,GN0000715%>"></asp:Label>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="col-md-3 col-sm-6 col-xs-12">
                                                                <div class="form-group form-float">

                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_CustomerNameGroupFilter" runat="server" />
                                                                        <asp:Label ID="Label14" runat="server" class="form-label" EnableViewState="false" Text="<%$ Resources:Content,GN0000268%>"></asp:Label>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="col-md-3 col-sm-6 col-xs-12">
                                                                <div class="form-group form-float">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_CompanyNameGroupFilter" runat="server" />
                                                                        <asp:Label ID="Label15" runat="server" class="form-label" EnableViewState="false" Text="<%$ Resources:Content,GN00001077%>"></asp:Label>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="col-sm-3 col-xs-12">
                                                                <div class="form-group form-float">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_TenantNameGroupFilter" runat="server"></asp:TextBox>
                                                                        <asp:Label CssClass="form-label" ID="Label8" runat="server" Text='<%$ Resources:Content,TenantName%>' EnableViewState="false" />
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-xs-12">
                                                                <asp:Button CssClass="btn btn-primary waves-effect" ID="Btn_FilterGroup" runat="server" Text='<%$ Resources:Content, GN0000395 %>' />
                                                                <asp:Button ID="Btn_ClearGroup" Visible="false" CssClass="btn btn-primary waves-effect" runat="server"
                                                                    Text="<%$ Resources:Content,String289 %>" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </asp:Panel>

                                    <%-- Phone Groups Listing --%>
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <asp:GridView ID="GV_PhoneGroups" CssClass="table table-bordered table-striped table-hover" AllowSorting="true" AllowPaging="true" EmptyDataText='<%$ Resources:Content, GN00001375 %>' runat="server" AutoGenerateColumns="False">
                                                <Columns>
                                                    <asp:TemplateField SortExpression="TenantName" HeaderText="<%$ Resources:Content,TenantName%>" HeaderStyle-CssClass="col-xs-3">
                                                        <ItemTemplate>
                                                            <asp:HyperLink ID="Hl_TenantName" runat="server"></asp:HyperLink>
                                                            <asp:HiddenField ID="HF_TenantId" runat="server" Value='<%# DataBinder.Eval(Container, "DataItem.TenantId") %>' />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField SortExpression="CustomerId" HeaderStyle-CssClass="col-xs-3" HeaderText="<%$ Resources:Content,GN0000715%>">
                                                        <ItemTemplate>
                                                            <asp:HyperLink ID="LB_ClientID" runat="server"></asp:HyperLink>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText='<%$ Resources:Content, DEV1128 %>' HeaderStyle-CssClass="col-xs-2">
                                                        <ItemTemplate>
                                                            <asp:Literal ID="Ltl_TotalNumbers" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.TotalNumbers") %>' />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText='<%$ Resources:Content, GN0000360 %>' HeaderStyle-CssClass="col-xs-2">
                                                        <ItemTemplate>

                                                            <asp:LinkButton ID="LB_Edit" CommandName="EditGroup" CssClass="btn btn-primary waves-effect" runat="server" Text="<%$ Resources:Content,GN0000276%>" />

                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                                <PagerTemplate>
                                                    <UC:Pager ID="Pager1" runat="server" />
                                                </PagerTemplate>
                                            </asp:GridView>
                                        </div>
                                    </div>
                                </asp:Panel>
                                <asp:Panel ID="Pnl_AddEditPhoneGroup" runat="server">
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <div class="card">
                                                <%--<div class="header">
                                                    <h3>
                                                        <asp:Label ID="Lbl_AddEditPhoneGroup" runat="server" Text='<%$ Resources:Content,DEV1126%>' /></h3>
                                                </div>--%>
                                                <div class="body">
                                                    <div class="row">
                                                        <div class="col-sm-3 col-xs-12 row-label">
                                                            *<asp:Literal ID="Literal15" runat="server" EnableViewState="false" Text='<%$ Resources:Content,StrSelectTenant%>' />:
                                                        </div>
                                                        <div class="col-sm-4 col-xs-12">
                                                            <div class="form-group">
                                                                <asp:DropDownList ID="DDL_TenantsGroupAddEdit" runat="server" AutoPostBack="true">
                                                                </asp:DropDownList>
                                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" InitialValue="-1" ValidationGroup="AddEdit" ControlToValidate="DDL_TenantsGroupAddEdit" Display="None" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                                            </div>
                                                        </div>
                                                    </div>

                                                    <div class="row">
                                                        <div class="col-xs-12 row-label">
                                                            <asp:Literal ID="Literal18" runat="server" Text="<%$ Resources:Content, DEV1120 %>"></asp:Literal>:
                                                        </div>
                                                    </div>

                                                    <div class="row">
                                                        <div class="col-sm-3 col-xs-12 row-label">
                                                            <asp:RadioButton ID="Rb_OnFly" Checked="true" runat="server" GroupName="RBPhoneNumbers" Text='<%$ Resources:Content,Lync303%>' />:
                                                        </div>
                                                        <div class="col-sm-4 col-xs-12">
                                                            <div class="form-group">
                                                                <asp:TextBox ID="TxBx_PhoneNumbers" runat="server" TextMode="MultiLine" Rows="5" Width="100%"></asp:TextBox>
                                                            </div>
                                                        </div>
                                                        <div class="col-sm-2 col-xs-12">
                                                            <button type="button" class="btn btn-info btn-block btn-xs waves-effect" style="width: 30px;" data-trigger="focus" data-container="body" data-toggle="popover"
                                                                data-placement="left" title="Phone Numbers" data-content="Please enter each number in new line.">
                                                                <i class="material-icons">info</i>
                                                            </button>
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-sm-3 col-xs-12 row-label">
                                                            <asp:RadioButton ID="Rb_Csv" runat="server" GroupName="RBPhoneNumbers" Text='<%$ Resources:Content,String380%>' />:
                                                        </div>
                                                        <div class="col-sm-4 col-xs-12">
                                                            <div class="fileupload fileupload-new" data-provides="fileupload">
                                                                <span class="btn btn-primary btn-file"><span class="fileupload-new"><%= Resources.Content.strSelectFile%></span>
                                                                    <span class="fileupload-exists"><%= Resources.Content.GN0000385%></span>
                                                                    <asp:FileUpload ID="FU_PhoneNumbers" runat="server" />
                                                                </span>
                                                                <span class="fileupload-preview"></span>
                                                                <a href="#" class="close fileupload-exists" data-dismiss="fileupload" style="float: none">×</a>

                                                            </div>
                                                        </div>
                                                        <div class="col-sm-4 col-xs-12">
                                                            <asp:Literal ID="Ltl_DownLoadCSV" runat="server"></asp:Literal>
                                                        </div>
                                                    </div>



                                                    <div class="row">
                                                        <div class="col-xs-12">
                                                            <asp:Button ID="Btn_SavePhoneGroup" ValidationGroup="AddEdit" CssClass="btn btn-primary waves-effect btnAction" runat="server" Text='<%$ Resources:Content,GN0000281%>' />
                                                            <asp:Button ID="Btn_CancelAddEditPhoneGroup" CssClass="btn btn-primary waves-effect" runat="server" Text='<%$ Resources:Content,GN0000572%>'
                                                                CausesValidation="false" />
                                                            <asp:ValidationSummary ID="ValidationSum_1" ValidationGroup="AddEdit" runat="server" HeaderText='<%$ Resources:Content,EM000001 %>'
                                                                ShowMessageBox="True" ShowSummary="False" />
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <asp:Button ID="Btn_RemoveExistingNumbers" runat="server" Custom1="Custom" Style="display: none" Text="<%$ Resources:Content,GN0000278%>" CssClass="btn btn-primary waves-effect" />
                                            <EM:ConfirmButtonExtender ID="ConfirmButtonExtender1" ConfirmText="<%$ Resources:Content,DGN1119974%>" TargetControlID="Btn_RemoveExistingNumbers" runat="server">
                                            </EM:ConfirmButtonExtender>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <EM:MPGridView ID="GV_PhoneNumbersAddEdit" CssClass="table table-bordered table-striped table-hover table-layout-fixed"
                                                AllowSorting="false" AllowPaging="true"
                                                EmptyDataText='<%$ Resources:Content, GN00001375 %>' runat="server" AutoGenerateColumns="False">
                                                <Columns>
                                                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-CssClass="col-xs-1" HeaderText='<%$ Resources:Content,GN0000370 %>'>
                                                        <HeaderTemplate>
                                                            <asp:CheckBox class="option-menu" ID="ChkBx_All" runat="server" Text=" " onclick="SetCheckedHeader(this.checked, this,'All');" />
                                                        </HeaderTemplate>
                                                        <ItemTemplate>
                                                            <asp:CheckBox class="option-menu" ID="ChkBx_Item" onclick="SetCheckedHeader(this.checked, this,'1');" Text="&nbsp;" runat="server"></asp:CheckBox>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField SortExpression="PhoneNumber" HeaderStyle-CssClass="col-xs-4" HeaderText='<%$ Resources:Content, PhoneNumber %>'>
                                                        <ItemTemplate>
                                                            <asp:Label ID="LB_PhoneNumber" runat="server" Text="" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField SortExpression="AssignTo" HeaderText="<%$ Resources:Content,DEV1133%>" HeaderStyle-CssClass="col-xs-5">
                                                        <ItemTemplate>
                                                            <asp:Label ID="LB_AssignedTo" runat="server" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText='<%$ Resources:Content, GN0000360 %>' HeaderStyle-CssClass="col-xs-2">
                                                        <ItemTemplate>
                                                            <asp:Button ID="Btn_RemoveFreePhone" runat="server" Text="<%$ Resources:Content,strRemove %>"
                                                                CssClass="btn btn-primary waves-effect btnAction" CommandName="RemoveFreePhone" />

                                                            <EM:ConfirmButtonExtender ID="CBE_RemoveFreePhone" runat="server" ConfirmText="<%$Resources:Content,strRemoveConfirmation%>"
                                                                TargetControlID="Btn_RemoveFreePhone">
                                                            </EM:ConfirmButtonExtender>

                                                        </ItemTemplate>

                                                    </asp:TemplateField>
                                                </Columns>
                                                <%--PagerTemplate Start--%>
                                                <PagerTemplate>
                                                    <UC:Pager ID="Pager" runat="server" />
                                                </PagerTemplate>
                                                <%--PagerTemplate End--%>
                                            </EM:MPGridView>
                                        </div>
                                    </div>
                                </asp:Panel>
                            </asp:Panel>
                        </ContentTemplate>
                    </EM:TabPanel>

                    <EM:TabPanel ID="Tab_ServicePhoneNumbers" runat="server" HeaderText="<%$ Resources:Content,ServicePNumbers %>">
                        <ContentTemplate>
                            <asp:Button ID="Btn_Tab4" runat="server" Style="display: none;" />
                            <asp:Panel ID="Pnl_TabContent4" runat="server" Visible="false">
                                <div class="products-step">
                                    <span id="div_s7" runat="server" nowrap="true" class="label label-default">
                                        <asp:LinkButton ID="Lb_ServicePNumbers" runat="server" Text='<%$ Resources:Content, Dev1089 %>' />
                                    </span>
                                    <span id="div_s8" runat="server" nowrap="true" class="label label-default">
                                        <asp:LinkButton ID="Lb_ServicePGroups" runat="server" Text='<%$ Resources:Content, Lync302 %>' />
                                    </span>
                                </div>
                                <div class="col-xs-12"></div>
                                <asp:Panel ID="Pnl_ServicePNumbers" runat="server">
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <asp:Panel ID="Pnl_ServicePhoneNumberListing" runat="server">
                                                <div class="Row Div_OpsRow" id="Div_ServicePhoneNumberOptions" runat="server">
                                                    <%--  <div class="col-xs-12">--%>
                                                    <div class="card">
                                                        <div class="header">
                                                            <h3>
                                                                <%= Resources.Content.SMI0423%>                                                                                                                                 
                                                            </h3>
                                                        </div>
                                                        <div class="body">
                                                            <div class="clearfix">
                                                                <asp:Button ID="Btn_AddServicePhoneNumber" class="btn btn-primary waves-effect btnAction" runat="server" Text='<%$ Resources:Content,OCS002 %>' />


                                                                <asp:Button ID="Btn_RemoveServicePhoneNumbers" runat="server" Custom1="Custom" Style="display: none" Text="<%$ Resources:Content,GN0000278%>" CssClass="btn btn-primary waves-effect btnAction" />
                                                                <EM:ConfirmButtonExtender ID="ConfirmButtonExtender2" ConfirmText="<%$ Resources:Content,DGN1119974%>" TargetControlID="Btn_RemoveServicePhoneNumbers" runat="server">
                                                                </EM:ConfirmButtonExtender>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="row">
                                                    <div class="col-xs-12"></div>
                                                </div>
                                                <%-- Search Panel --%>
                                                <asp:Panel ID="Panel2" runat="server" CssClass="row" DefaultButton="Btn_ApplyFilter_SPNumbers">
                                                    <div class="panel-group search-panel" id="AS_SPNumbers" role="tablist" aria-multiselectable="true">
                                                        <div class="col-xs-12" role="tab" id="SH_SPNumbers">

                                                            <div class="card">
                                                                <div class="header" role="button" data-toggle="collapse" data-parent="#AS_SPNumbers" href="#<%= CSB_SPNumbers.ClientID%>" aria-expanded="true" aria-controls="SH_SPNumbers">
                                                                    <h3>
                                                                        <%= Resources.Content.GN0000395%>
                                                                    </h3>
                                                                </div>

                                                                <div id="CSB_SPNumbers" runat="server" class="body panel-collapse collapse" role="tabpanel" aria-labelledby="SH_SPNumbers" aria-expanded="false">
                                                                    <div class="row">
                                                                        <div class="col-md-3 col-sm-6 col-xs-12">
                                                                            <div class="form-group form-float">
                                                                                <asp:DropDownList ID="DDL_OwnerSPNumberFilter" runat="server" onchange="setOwnerCookie(this)">
                                                                                </asp:DropDownList>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-3 col-sm-6 col-xs-12">
                                                                            <div class="form-group form-float">
                                                                                <div class="form-line">
                                                                                    <asp:TextBox ID="TxBx_SrchSPNumber" runat="server" CssClass="allowonlyintegervalues" MaxLength="19"></asp:TextBox>
                                                                                    <asp:Label ID="Label16" runat="server" class="form-label" EnableViewState="false" Text="<%$ Resources:Content,PhoneNumber%>"></asp:Label>
                                                                                </div>

                                                                            </div>
                                                                            <asp:RangeValidator ID="RV_TxBx_SrchSPNumber" runat="server" ControlToValidate="TxBx_SrchSPNumber"
                                                                                Display="None" SetFocusOnError="true" ValidationGroup="SearchSPNumbers"
                                                                                ErrorMessage="<%$ Resources:Content,DGN1110070 %>" Type="Double"
                                                                                MinimumValue="0" MaximumValue="9223372036854775807"></asp:RangeValidator>
                                                                        </div>
                                                                        <div class="col-md-3 col-sm-6 col-xs-12">
                                                                            <div class="form-group form-float">
                                                                                <div class="form-line">
                                                                                    <asp:TextBox ID="TxBx_SearchSPAssignTo" runat="server" MaxLength="19"></asp:TextBox>
                                                                                    <asp:Label ID="Label17" runat="server" class="form-label" EnableViewState="false" Text="<%$ Resources:Content,DEV1133%>"></asp:Label>
                                                                                </div>

                                                                            </div>
                                                                        </div>

                                                                        <div class="col-md-3 col-sm-6 col-xs-12">
                                                                            <div class="form-group form-float">
                                                                                <div class="form-line">
                                                                                    <asp:TextBox ID="TxBx_TenantNameSPNumberFilter" runat="server" MaxLength="200"></asp:TextBox>
                                                                                    <asp:Label ID="Label22" class="form-label" runat="server" Text="<%$ Resources:Content,TenantName %>"></asp:Label>
                                                                                </div>

                                                                            </div>
                                                                        </div>

                                                                        <div class="col-md-3 col-sm-6 col-xs-12">
                                                                            <div class="form-group form-float">
                                                                                <div class="form-line">
                                                                                    <asp:TextBox ID="TxBx_CustomerIDSPNumberFilter" runat="server" />
                                                                                    <asp:Label ID="Label23" runat="server" class="form-label" EnableViewState="false" Text="<%$ Resources:Content,GN0000715%>"></asp:Label>
                                                                                </div>
                                                                            </div>
                                                                        </div>

                                                                        <div class="col-md-3 col-sm-6 col-xs-12">
                                                                            <div class="form-group form-float">

                                                                                <div class="form-line">
                                                                                    <asp:TextBox ID="TxBx_CustomerNameSPNumberFilter" runat="server" />
                                                                                    <asp:Label ID="Label24" runat="server" class="form-label" EnableViewState="false" Text="<%$ Resources:Content,GN0000268%>"></asp:Label>
                                                                                </div>
                                                                            </div>
                                                                        </div>

                                                                        <div class="col-md-3 col-sm-6 col-xs-12">
                                                                            <div class="form-group form-float">
                                                                                <div class="form-line">
                                                                                    <asp:TextBox ID="TxBx_CompanyNameSPNumberFilter" runat="server" />
                                                                                    <asp:Label ID="Label25" runat="server" class="form-label" EnableViewState="false" Text="<%$ Resources:Content,GN00001077%>"></asp:Label>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-xs-12">
                                                                            <div class="form-group form-float">
                                                                                <asp:ValidationSummary ID="VS_SearchSPNumbers" runat="server" ShowMessageBox="true"
                                                                                    ShowSummary="false" ValidationGroup="SearchSPNumbers" />
                                                                                <asp:Button ID="Btn_ApplyFilter_SPNumbers" ValidationGroup="SearchSPNumbers" class="btn btn-primary waves-effect" runat="server" Text="<%$ Resources:Content,GN0000391%>" />
                                                                                <asp:Button ID="Btn_ClearFilter_SPNumbers" class="btn btn-primary waves-effect" Visible="false" runat="server" Text="<%$ Resources:Content,String289 %>" />

                                                                            </div>
                                                                        </div>

                                                                    </div>
                                                                </div>
                                                            </div>

                                                        </div>
                                                    </div>
                                                </asp:Panel>
                                                <div class="row">
                                                    <div class="col-xs-12">
                                                        <EM:MPGridView ID="GV_ServicePhoneNumbers" CssClass="table table-bordered table-striped table-hover" AllowSorting="true" AllowPaging="true"
                                                            EmptyDataText='<%$ Resources:Content, GN00001375 %>' runat="server" AutoGenerateColumns="False">
                                                            <Columns>
                                                                <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-CssClass="col-xs-1" HeaderText='<%$ Resources:Content,GN0000370 %>'>
                                                                    <HeaderTemplate>
                                                                        <asp:CheckBox class="option-menu" ID="ChkBx_All" runat="server" Text=" " onclick="SetCheckedHeader(this.checked, this,'All');" />
                                                                    </HeaderTemplate>
                                                                    <ItemTemplate>
                                                                        <asp:CheckBox class="option-menu" ID="ChkBx_Item" onclick="SetCheckedHeader(this.checked, this,'1');" Text="&nbsp;" runat="server"></asp:CheckBox>
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>

                                                                <asp:TemplateField SortExpression="PhoneNumber" HeaderText='<%$ Resources:Content, PhoneNumber %>'>
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="LB_PhoneNumber" runat="server" Text="" />
                                                                        <asp:HiddenField ID="Hf_TenantId" runat="server" />
                                                                        <asp:HiddenField ID="Hf_BridgeName" runat="server" />
                                                                        <asp:HiddenField ID="Hf_BridgeId" runat="server" />
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>
                                                                <asp:TemplateField SortExpression="TenantName" HeaderText="<%$ Resources:Content,TenantName%>" HeaderStyle-CssClass="col-xs-3">
                                                                    <ItemTemplate>
                                                                        <asp:HyperLink ID="Hl_TenantName" runat="server"></asp:HyperLink>
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>

                                                                <asp:TemplateField SortExpression="AssignTo" HeaderText="<%$ Resources:Content,DEV1133%>" HeaderStyle-CssClass="col-xs-3">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="LB_AssignedTo" runat="server" />
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>


                                                                <asp:TemplateField HeaderText='<%$ Resources:Content, GN0000360 %>' HeaderStyle-CssClass="col-xs-2">
                                                                    <ItemTemplate>
                                                                        <asp:Button ID="Btn_RemoveFreePhone" runat="server" Text="<%$ Resources:Content,strRemove %>"
                                                                            CssClass="btn btn-primary waves-effect btnAction" CommandName="RemoveFreePhone" />

                                                                        <EM:ConfirmButtonExtender ID="CBE_RemoveFreePhone" runat="server" ConfirmText="<%$Resources:Content,strRemoveConfirmation%>"
                                                                            TargetControlID="Btn_RemoveFreePhone">
                                                                        </EM:ConfirmButtonExtender>

                                                                    </ItemTemplate>

                                                                </asp:TemplateField>
                                                            </Columns>
                                                            <PagerTemplate>
                                                                <UC:Pager ID="Pager" runat="server" />
                                                            </PagerTemplate>
                                                        </EM:MPGridView>
                                                    </div>
                                                </div>
                                            </asp:Panel>
                                            <asp:Panel ID="Pnl_AddServicePhoneNumber" runat="server">
                                                <div class="card">
                                                    <div class="header">
                                                        <h3>
                                                            <%= Resources.Content.OCS002%>                                                                                                                                 
                                                        </h3>
                                                    </div>
                                                    <div class="body">
                                                        <div class="row">
                                                            <div class="col-sm-3 col-xs-12 row-label">
                                                                *<asp:Literal ID="Literal19" runat="server" EnableViewState="false" Text='<%$ Resources:Content,StrSelectTenant%>' />:
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:DropDownList ID="DDL_TenantsSPNumbers" runat="server" AutoPostBack="true">
                                                                    </asp:DropDownList>
                                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" InitialValue="-1" ValidationGroup="AddServicePNumber" ControlToValidate="DDL_TenantsSPNumbers" Display="None" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-3 col-xs-12 row-label">
                                                                *<asp:Literal ID="Literal11" runat="server" Text='<%$ Resources:Content,strPhoneNumber %>' />:
                                                            </div>

                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">

                                                                    <asp:TextBox ID="TxBx_ServicePhoneNumber" runat="server" TextMode="MultiLine" Rows="8"></asp:TextBox>

                                                                </div>
                                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                                                                    ControlToValidate="TxBx_ServicePhoneNumber"
                                                                    Display="None" ValidationGroup="AddServicePNumber" SetFocusOnError="True"></asp:RequiredFieldValidator>

                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <asp:Literal ID="Literal14" runat="server" Text="<%$ Resources:Content,strTeamPhoneNumberMsg%>"></asp:Literal>
                                                                <br />
                                                                <asp:Literal ID="Literal17" runat="server" Text="<%$ Resources:Content,strPhoneNumberHint%>"></asp:Literal>
                                                            </div>

                                                        </div>


                                                        <div class="row">
                                                            <div class="col-xs-12">
                                                                <asp:ValidationSummary ID="ValidationSummary4" runat="server" ShowMessageBox="true" ShowSummary="false"
                                                                    ValidationGroup="AddServicePNumber" HeaderText="<%$ Resources:Content,EM000001%>" />
                                                                <asp:Button ID="Btn_SaveServicePhoneNumber" ValidationGroup="AddServicePNumber" class="btn btn-primary waves-effect btnAction" runat="server" Text='<%$ Resources:Content,GN0000281 %>' />
                                                                <asp:Button ID="Btn_CancelServicePhoneNumber" CausesValidation="false" runat="server" Text='<%$ Resources:Content,GN0000572 %>' class="btn btn-primary waves-effect" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </asp:Panel>
                                        </div>
                                    </div>
                                </asp:Panel>

                                <asp:Panel ID="Pnl_ServicePGroups" runat="server">
                                    <%-- Operations --%>
                                    <div class="row Div_OpsRow" id="Div_OpsRow3" runat="server">
                                        <div class="col-xs-12">
                                            <div class="card">
                                                <div class="header">
                                                    <h3>
                                                        <%= Resources.Content.GN00001320%>                                                                                                                                 
                                                    </h3>
                                                </div>
                                                <div class="body">
                                                    <div class="row">
                                                        <div class="col-xs-12">
                                                            <asp:Button ID="Btn_AddServicePGroup" class="btn btn-primary waves-effect btnAction" runat="server"
                                                                Text='<%$ Resources:Content,DEV1116%>' />
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <%-- Search --%>
                                    <asp:Panel ID="Pnl_SearchSP" runat="server" CssClass="row" DefaultButton="Btn_FilterSPGroup">
                                        <div class="panel-group search-panel" id="AS_SPGroups" role="tablist" aria-multiselectable="true">
                                            <div class="col-xs-12" role="tab" id="SH_SPGroups">
                                                <div class="card">
                                                    <div class="header" role="button" data-toggle="collapse" data-parent="#AS_SPGroups" href="#<%= CSB_SPGroups.ClientID%>" aria-expanded="true" aria-controls="SH_SPGroups">
                                                        <h3>
                                                            <%= Resources.Content.GN0000395%>
                                                        </h3>
                                                    </div>
                                                    <div id="CSB_SPGroups" runat="server" class="body panel-collapse collapse" role="tabpanel" aria-labelledby="SH_SPGroups" aria-expanded="false">
                                                        <div class="row">
                                                            <div class="col-sm-3 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:DropDownList ID="Ddl_OwnerSPGroupFilter" runat="server">
                                                                    </asp:DropDownList>
                                                                </div>
                                                            </div>

                                                            <div class="col-md-3 col-sm-6 col-xs-12">
                                                                <div class="form-group form-float">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_CustomerIDSPGroupFilter" runat="server" />
                                                                        <asp:Label ID="Label18" runat="server" class="form-label" EnableViewState="false" Text="<%$ Resources:Content,GN0000715%>"></asp:Label>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="col-md-3 col-sm-6 col-xs-12">
                                                                <div class="form-group form-float">

                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_CustomerNameSPGroupFilter" runat="server" />
                                                                        <asp:Label ID="Label19" runat="server" class="form-label" EnableViewState="false" Text="<%$ Resources:Content,GN0000268%>"></asp:Label>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="col-md-3 col-sm-6 col-xs-12">
                                                                <div class="form-group form-float">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_CompanyNameSPGroupFilter" runat="server" />
                                                                        <asp:Label ID="Label20" runat="server" class="form-label" EnableViewState="false" Text="<%$ Resources:Content,GN00001077%>"></asp:Label>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="col-sm-3 col-xs-12">
                                                                <div class="form-group form-float">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_TenantNameSPGroupFilter" runat="server"></asp:TextBox>
                                                                        <asp:Label CssClass="form-label" ID="Label21" runat="server" Text='<%$ Resources:Content,TenantName%>' EnableViewState="false" />
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-xs-12">
                                                                <asp:Button CssClass="btn btn-primary waves-effect" ID="Btn_FilterSPGroup" runat="server" Text='<%$ Resources:Content, GN0000395 %>' />
                                                                <asp:Button ID="Btn_ClearSPGroup" Visible="false" CssClass="btn btn-primary waves-effect" runat="server"
                                                                    Text="<%$ Resources:Content,String289 %>" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </asp:Panel>

                                    <%-- Service Phone Groups Listing --%>
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <asp:GridView ID="GV_ServicePhoneGroups" CssClass="table table-bordered table-striped table-hover" AllowSorting="true" AllowPaging="true" EmptyDataText='<%$ Resources:Content, GN00001375 %>' runat="server" AutoGenerateColumns="False">
                                                <Columns>
                                                    <asp:TemplateField SortExpression="TenantName" HeaderText='<%$ Resources:Content, TenantName %>'>
                                                        <ItemTemplate>
                                                            <asp:HiddenField ID="HF_TenantId" runat="server" Value='<%# DataBinder.Eval(Container, "DataItem.TenantId") %>' />
                                                            <asp:LinkButton ID="LB_TenantName" CommandName="EditGroup" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.TenantName") %>' />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField SortExpression="CustomerId" HeaderStyle-CssClass="col-xs-3" HeaderText="<%$ Resources:Content,GN0000715%>">
                                                        <ItemTemplate>
                                                            <asp:HyperLink ID="LB_ClientID" runat="server"></asp:HyperLink>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText='<%$ Resources:Content, DEV1128 %>' HeaderStyle-CssClass="col-xs-2">
                                                        <ItemTemplate>
                                                            <asp:Literal ID="Ltl_TotalNumbers" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.TotalNumbers") %>' />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText='<%$ Resources:Content, GN0000360 %>' HeaderStyle-CssClass="col-xs-2">
                                                        <ItemTemplate>

                                                            <asp:LinkButton ID="LB_Edit" CommandName="EditGroup" CssClass="btn btn-primary waves-effect" runat="server" Text="<%$ Resources:Content,GN0000276%>" />

                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                                <PagerTemplate>
                                                    <UC:Pager ID="Pager1" runat="server" />
                                                </PagerTemplate>
                                            </asp:GridView>
                                        </div>
                                    </div>
                                </asp:Panel>

                                <asp:Panel ID="Pnl_AddEditServicePGroup" runat="server">
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <div class="card">
                                                <div class="header">
                                                    <h3>
                                                        <asp:Label ID="Lbl_AddEditSPGroup" runat="server" Text='<%$ Resources:Content,DEV1126%>' /></h3>
                                                </div>
                                                <div class="body">
                                                    <div class="row">
                                                        <div class="col-sm-3 col-xs-12 row-label">
                                                            *<asp:Literal ID="Literal20" runat="server" EnableViewState="false" Text='<%$ Resources:Content,StrSelectTenant%>' />:
                                                        </div>
                                                        <div class="col-sm-4 col-xs-12">
                                                            <div class="form-group">
                                                                <asp:DropDownList ID="DDL_TenantsSPGroupAddEdit" runat="server" AutoPostBack="true">
                                                                </asp:DropDownList>
                                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" InitialValue="-1" ValidationGroup="AddEditSPGroup" ControlToValidate="DDL_TenantsSPGroupAddEdit" Display="None" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-sm-3 col-xs-12 row-label">
                                                            *<asp:Literal ID="Literal21" runat="server" Text='<%$ Resources:Content,strPhoneNumber %>' />:
                                                        </div>

                                                        <div class="col-sm-4 col-xs-12">
                                                            <div class="form-group">

                                                                <asp:TextBox ID="TxBx_SPNumbers" runat="server" TextMode="MultiLine" Rows="8"></asp:TextBox>

                                                            </div>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server"
                                                                ControlToValidate="TxBx_SPNumbers"
                                                                Display="None" ValidationGroup="AddEditSPGroup" SetFocusOnError="True"></asp:RequiredFieldValidator>

                                                        </div>
                                                        <div class="col-sm-4 col-xs-12">
                                                            <asp:Literal ID="Literal22" runat="server" Text="<%$ Resources:Content,strTeamPhoneNumberMsg%>"></asp:Literal>
                                                            <br />
                                                            <asp:Literal ID="Literal23" runat="server" Text="<%$ Resources:Content,strPhoneNumberHint%>"></asp:Literal>
                                                        </div>

                                                    </div>
                                                    <div class="row">
                                                        <div class="col-xs-12">
                                                            <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="true" ShowSummary="false"
                                                                ValidationGroup="AddEditSPGroup" HeaderText="<%$ Resources:Content,EM000001%>" />
                                                            <asp:Button ID="Btn_SaveServicePhoneGroup" ValidationGroup="AddEditSPGroup" class="btn btn-primary waves-effect btnAction" runat="server" Text='<%$ Resources:Content,GN0000281 %>' />
                                                            <asp:Button ID="Btn_CancelServicePhoneGroup" CausesValidation="false" runat="server" Text='<%$ Resources:Content,GN0000572 %>' class="btn btn-primary waves-effect" />
                                                        </div>
                                                    </div>

                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <asp:Button ID="Btn_RemoveSelectedSPNumbers" runat="server" Custom1="Custom" Style="display: none" Text="<%$ Resources:Content,GN0000278%>" CssClass="btn btn-primary waves-effect" />
                                            <EM:ConfirmButtonExtender ID="ConfirmButtonExtender3" ConfirmText="<%$ Resources:Content,DGN1119974%>" TargetControlID="Btn_RemoveSelectedSPNumbers" runat="server">
                                            </EM:ConfirmButtonExtender>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <EM:MPGridView ID="GV_SPNumbersAddEdit" CssClass="table table-bordered table-striped table-hover table-layout-fixed"
                                                AllowSorting="false" AllowPaging="true"
                                                EmptyDataText='<%$ Resources:Content, GN00001375 %>' runat="server" AutoGenerateColumns="False">
                                                <Columns>
                                                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-CssClass="col-xs-1" HeaderText='<%$ Resources:Content,GN0000370 %>'>
                                                        <HeaderTemplate>
                                                            <asp:CheckBox class="option-menu" ID="ChkBx_All" runat="server" Text=" " onclick="SetCheckedHeader(this.checked, this,'All');" />
                                                        </HeaderTemplate>
                                                        <ItemTemplate>
                                                            <asp:CheckBox class="option-menu" ID="ChkBx_Item" onclick="SetCheckedHeader(this.checked, this,'1');" Text="&nbsp;" runat="server"></asp:CheckBox>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField SortExpression="PhoneNumber" HeaderStyle-CssClass="col-xs-4" HeaderText='<%$ Resources:Content, PhoneNumber %>'>
                                                        <ItemTemplate>
                                                            <asp:Label ID="LB_PhoneNumber" runat="server" Text="" />
                                                            <asp:HiddenField ID="Hf_TenantId" runat="server" />
                                                            <asp:HiddenField ID="Hf_BridgeName" runat="server" />
                                                            <asp:HiddenField ID="Hf_BridgeId" runat="server" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField SortExpression="AssignTo" HeaderText="<%$ Resources:Content,DEV1133%>" HeaderStyle-CssClass="col-xs-5">
                                                        <ItemTemplate>
                                                            <asp:Label ID="LB_AssignedTo" runat="server" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText='<%$ Resources:Content, GN0000360 %>' HeaderStyle-CssClass="col-xs-2">
                                                        <ItemTemplate>
                                                            <asp:Button ID="Btn_RemoveFreePhone" runat="server" Text="<%$ Resources:Content,strRemove %>"
                                                                CssClass="btn btn-primary waves-effect btnAction" CommandName="RemoveFreePhone" />

                                                            <EM:ConfirmButtonExtender ID="CBE_RemoveFreePhone" runat="server" ConfirmText="<%$Resources:Content,strRemoveConfirmation%>"
                                                                TargetControlID="Btn_RemoveFreePhone">
                                                            </EM:ConfirmButtonExtender>

                                                        </ItemTemplate>

                                                    </asp:TemplateField>
                                                </Columns>
                                                <%--PagerTemplate Start--%>
                                                <PagerTemplate>
                                                    <UC:Pager ID="Pager" runat="server" />
                                                </PagerTemplate>
                                                <%--PagerTemplate End--%>
                                            </EM:MPGridView>
                                        </div>
                                    </div>
                                </asp:Panel>
                            </asp:Panel>
                        </ContentTemplate>
                    </EM:TabPanel>
                </EM:TabContainer>

            </div>
        </div>
    </div>

    <EM:TenantServicePrincipalError ID="TenantServicePrincipalError1" runat="server" />

    <script type="text/javascript">

        $(document).ready(function () {

            if ($("a[id$='Lbtn_GrantAdminConsent']").length > 0)
                O365GrantHelpIconPopover($("a[id$='Lbtn_GrantAdminConsent']").get(0).id, '<%= Resources.Content.StrO365ConsentHelpTitle %>', '<%= Resources.Content.StrO365ConsentHelpContent %>');
        });

        $("a[id$='Lbtn_GrantAdminConsent']").on('click', function () {

            let emailpattern = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;

            if ($("input[id$='TxBx_InputTenantLogin']").val() == null || $("input[id$='TxBx_InputTenantLogin']").val() == '') {
                alert('<%= Resources.Content.strAdminLoginRequired %>');
                return false;
            }
            else if ($("input[id$='TxBx_InputTenantLogin']").val().search(emailpattern) == -1) {
                alert('<%= Resources.Content.strAdminLoginMustBeEmail %>');
                return false;
            }

            let baseURL = $(location).attr('protocol') + '//' + $(location).attr('host');
            var param;

            let params = (new URL(document.location)).searchParams;

            let tId = params.get("TId");
            if (!tId) { tId = params.get("TID"); }
            if (!tId) { tId = params.get("tid"); }
            if (!tId) { console.log('tid: not found'); }

            let manageSP = false;
            if ($("input[id$='CB_ManageSharepointOnline']").get(0))
                manageSP = $("input[id$='CB_ManageSharepointOnline']").get(0).checked;
            let appPass = '';
            if ($("input[id$='TxBx_InputTenantPswrd']").get(0))
                appPass = $("input[id$='TxBx_InputTenantPswrd']").val();

            param = `{page: '${document.location}', tId:${tId}, adminLogin: '${$("input[id$='TxBx_InputTenantLogin']").val()}', manageSP: ${manageSP}, appPass: '${appPass}'}`;

            $.ajax({
                type: "POST",
                url: baseURL + "/rcc/o365/tenants.aspx/getconsenteventhandler",
                data: param,
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                    if (response.d) {
                        var F = new Function(response.d);
                        return (F());
                    }
                },
                error: function (err) { console.log("get consent event handler instructions failed: " + param, err); }
            });

        });

    </script>
</asp:Content>

