SHA256
GuestLog - StayEntry pages fixes
- Details/New - Fixed time field binding. Now it binds directly to the Model instead of using temp TimeSpans. - New - Fixed StayEntry validation to allow creating Stays with a DateOut in the past. - List - Added ordering to db results so limit behaves in a deterministic way. Fixed default search so stays created today are shown.
This commit is contained in:
@@ -27,7 +27,8 @@
|
||||
|
||||
@if (stayModel is not null)
|
||||
{
|
||||
<StayEntryForm Model="stayModel" ReadOnly="true" />
|
||||
<StayEntryForm Model="stayModel" FormMode="FormMode.ReadOnly" />
|
||||
<MudText Class="mt-4">@CreateTimeString</MudText>
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +42,22 @@
|
||||
|
||||
StayEntryDTO? stayModel = null;
|
||||
|
||||
private string? CreateTimeString
|
||||
{
|
||||
get
|
||||
{
|
||||
if (stayModel is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
List<string> textList = [];
|
||||
textList.Add($"Created at: {stayModel.CreateTime?.ToString() ?? "???"}");
|
||||
textList.Add($"Last Update Time: {stayModel.UpdateTime?.ToString() ?? "???"}");
|
||||
return string.Join("; ", textList);
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
@* if (StayId is default)
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
private StayEntryFilterDTO stayFilter = new StayEntryFilterDTO()
|
||||
{
|
||||
DateInStart = DateTime.Today.AddDays(-14),
|
||||
DateInEnd = DateTime.Today,
|
||||
DateInEnd = DateTime.Today.AddDays(1),
|
||||
};
|
||||
|
||||
private IEnumerable<StayEntryDTO> stayEntryList = [];
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
|
||||
<StayEntryForm @ref="_form" Model="@newStayModel" />
|
||||
<StayEntryForm @ref="_form" Model="@newStayModel" FormMode="FormMode.Create" />
|
||||
|
||||
@code {
|
||||
StayEntryForm _form = null!;
|
||||
|
||||
Reference in New Issue
Block a user