GuestLog - General Improvements.

- GuestDocument details - Added navigation to details for stays.
- StayEntry details - Added dialog to see details of GuestDocuments.
- StayEntry List - Added filter for result table.
- StayEntry New - Show suggested guests on GuestSearchDialog so no searchs are required in some cases.
- NavMenu - Removed default navigation links.
This commit is contained in:
2026-08-18 22:17:16 +02:00
parent 340bc583b7
commit 0de4e1ba10
12 changed files with 227 additions and 36 deletions
@@ -34,6 +34,14 @@
@if (!isLoading)
{
@* Only show on first load *@
@if (loadCount == 1)
{
<MudText Align="Align.Center" GutterBottom>
@LanguageLocale.control_GuestDocumentSearchDialog_txtSuggestedGuests
</MudText>
}
<MudList T="GuestDocumentDTO" @bind-SelectedValue="SelectedResult"
SelectionMode="SelectionMode.SingleSelection" Color="Color.Info">
@foreach (GuestDocumentDTO result in results)
@@ -74,10 +82,39 @@
private GuestDocumentDTO? SelectedResult { get; set; }
private bool isLoading = false;
private int loadCount = 0;
protected override async Task OnInitializedAsync()
{
//Load last 5 guests.
await LoadGuests(limit: 5);
}
private void Cancel() => MudDialog.Cancel();
private async Task LoadGuests(int limit = 25)
{
try
{
isLoading = true;
results = await guestDocumentService.GetDtoListByFilterAsync(filter);
isLoading = false;
loadCount++;
}
catch (Exception ex)
{
logger.LogError(ex, "GuestDocument Search returned an error!");
Snackbar.Add($"Error searching: {ex.Message}", Severity.Error);
}
}
#region Event Handlers
private async Task BtnSearchGuestDocuments()
{
if (filter.IsEmpty)
@@ -86,17 +123,8 @@
return;
}
try
{
isLoading = true;
results = await guestDocumentService.GetDtoListByFilterAsync(filter);
isLoading = false;
}
catch (Exception ex)
{
logger.LogError(ex, "GuestDocument Search returned an error!");
Snackbar.Add($"Error searching: {ex.Message}", Severity.Error);
}
//Load unlimited guests using current filter.
await LoadGuests();
}
private async Task btnSelectGuest()
@@ -114,4 +142,7 @@
MudDialog.Close(dialogResult);
return;
}
#endregion
}