@using Zap.BI.Core.Security
@using Zap.BI.Portal.Pages.Diagnostics
@using Zap.Collections
@model Zap.BI.Portal.Models.Diagnostics.SecurityPrincipalListModel

@{
    Layout = null;
}

@if (Model.Principals != null)
{
    if (Model.Principals.None())
    {
        <p><b>- @DiagnosticText.ADDiagnostics_NoResults -</b></p>
    }
    else
    {
        <table>
            <tr>
                <th>@DiagnosticText.ADDiagnostics_Name</th>
                <th>@DiagnosticText.ADDiagnostics_SecurityPrincipals_Email</th>

            </tr>
            @foreach (SecurityPrincipal principal in Model.Principals.OrderBy(p => p.FullName))
            {
                <tr>
                    <td>@principal.FullName</td>
                    <td>@principal.Email</td>
                </tr>
            }
        </table>
    
        if (Model.Principals.Count() > 1)
        {
            <p><b>[@Model.Principals.Count()]</b></p>
        }
    }
}
<br/>