@inject ContactManagementAPI.Services.UserContextService UserContext @model IEnumerable @using System.Linq @{ ViewData["Title"] = "All Contacts"; var searchTerm = ViewBag.SearchTerm ?? ""; // Default ordering: by Name ascending (FirstName then LastName) var sortedModel = Model.OrderBy(c => ((c.FirstName ?? "").Trim() + " " + (c.LastName ?? "").Trim()).Trim()); var listedCount = sortedModel.Count(); } @Html.AntiForgeryToken()
@if (TempData["SuccessMessage"] != null) {
@TempData["SuccessMessage"]
} @if (TempData["ErrorMessage"] != null) {
@TempData["ErrorMessage"]
}

All Contacts

Dashboard Find Duplicates @if (UserContext.HasRight(RightsCatalog.ContactsCreate)) { Add New Contact Import } @if (UserContext.HasRight(RightsCatalog.ContactsView)) { }
@if (!string.IsNullOrEmpty(searchTerm)) { Clear }
@if (!string.IsNullOrEmpty(searchTerm)) {

Showing results for "@searchTerm"

}
@if (!sortedModel.Any()) {

No contacts found. @if (UserContext.HasRight(RightsCatalog.ContactsCreate)) { Create your first contact }

} else { @if (UserContext.HasRight(RightsCatalog.ContactsDelete)) { }
@if (UserContext.HasRight(RightsCatalog.ContactsDelete)) { } @{ var contactsList = sortedModel.ToList(); } @for (var __i = 0; __i < contactsList.Count; __i++) { var contact = contactsList[__i]; var _rowBg = (__i % 2 == 0) ? "#f3f7fb" : "#ffffff"; @if (UserContext.HasRight(RightsCatalog.ContactsDelete)) { } }
Photo Name Email Phone WhatsApp City Group Actions
@if (!string.IsNullOrEmpty(contact.PhotoPath)) { @contact.FirstName @contact.LastName } else {
@contact.FirstName?.Substring(0, 1)@contact.LastName?.Substring(0, 1)
}
@contact.FirstName @contact.LastName @if (!string.IsNullOrEmpty(contact.NickName)) {
(@contact.NickName) }
@if (!string.IsNullOrEmpty(contact.Email)) { @contact.Email } else { - } @if (!string.IsNullOrEmpty(contact.Mobile1)) { @contact.Mobile1 } else { - } @if (!string.IsNullOrEmpty(contact.WhatsAppNumber)) { @contact.WhatsAppNumber } else { - } @if (!string.IsNullOrEmpty(contact.City)) { @contact.City } else { - } @if (contact.Group != null) { @contact.Group.Name } else { Unassigned }
@if (UserContext.HasRight(RightsCatalog.ContactsEdit)) { } @if (UserContext.HasRight(RightsCatalog.ContactsDelete)) { }
Showing @listedCount contact(s) @if (!string.IsNullOrEmpty(searchTerm)) { for "@searchTerm" } .
}
@section Scripts { }