diff --git a/Elwig/Services/DeliveryAncmtService.cs b/Elwig/Services/DeliveryAncmtService.cs index cd880e5..d07410e 100644 --- a/Elwig/Services/DeliveryAncmtService.cs +++ b/Elwig/Services/DeliveryAncmtService.cs @@ -9,7 +9,6 @@ using Elwig.Documents; using Elwig.Helpers.Export; using Elwig.Models.Dtos; using Microsoft.Win32; -using System.Net.Http; using System.Windows.Input; using System.Windows; using System; @@ -27,6 +26,8 @@ namespace Elwig.Services { } public static void ClearInputs(this DeliveryAncmtAdminViewModel vm) { + vm.StatusAncmtCreated = "-"; + vm.StatusAncmtModified = "-"; } public static async Task FillInputs(this DeliveryAncmtAdminViewModel vm, DeliveryAncmt a) { @@ -34,6 +35,8 @@ namespace Elwig.Services { vm.DeliverySchedule = (DeliverySchedule?)ControlUtils.GetItemFromSourceWithPk(vm.DeliveryScheduleSource, a.Year, a.DsNr); vm.SortId = a.SortId; vm.Weight = a.Weight; + vm.StatusAncmtCreated = $"{a.CreatedTimestamp:dd.MM.yyyy, HH:mm} ({a.Type})"; + vm.StatusAncmtModified = a.ModifiedTimestamp != a.CreatedTimestamp ? $"{a.ModifiedTimestamp:dd.MM.yyyy, HH:mm}" : "-"; } public static async Task<(List, IQueryable, List)> GetFilters(this DeliveryAncmtAdminViewModel vm, AppDbContext ctx) { diff --git a/Elwig/ViewModels/DeliveryAncmtAdminViewModel.cs b/Elwig/ViewModels/DeliveryAncmtAdminViewModel.cs index 4e5cbf6..9aecb7d 100644 --- a/Elwig/ViewModels/DeliveryAncmtAdminViewModel.cs +++ b/Elwig/ViewModels/DeliveryAncmtAdminViewModel.cs @@ -62,6 +62,15 @@ namespace Elwig.ViewModels { set => WeightString = $"{value}"; } + [ObservableProperty] + private string _statusAncmts = "-"; + [ObservableProperty] + private string _statusWeight = "-"; + [ObservableProperty] + private string _statusAncmtCreated = "-"; + [ObservableProperty] + private string _statusAncmtModified = "-"; + [ObservableProperty] private Visibility _controlButtonsVisibility = Visibility.Visible; [ObservableProperty] diff --git a/Elwig/Windows/DeliveryAncmtAdminWindow.xaml b/Elwig/Windows/DeliveryAncmtAdminWindow.xaml index 867e7c1..8fea383 100644 --- a/Elwig/Windows/DeliveryAncmtAdminWindow.xaml +++ b/Elwig/Windows/DeliveryAncmtAdminWindow.xaml @@ -307,9 +307,11 @@ + + - + @@ -317,7 +319,27 @@ - + + Anmeldungen: + + + + + + Gewicht: + + + + + + Anmldg. erstellt: + + + + + + Anmldg. geƤndert: + diff --git a/Elwig/Windows/DeliveryAncmtAdminWindow.xaml.cs b/Elwig/Windows/DeliveryAncmtAdminWindow.xaml.cs index 9fa2e2f..ee4d8be 100644 --- a/Elwig/Windows/DeliveryAncmtAdminWindow.xaml.cs +++ b/Elwig/Windows/DeliveryAncmtAdminWindow.xaml.cs @@ -127,6 +127,9 @@ namespace Elwig.Windows { DeliveryAncmtList_SelectionChanged, ViewModel.TextFilter.Count > 0 ? ControlUtils.RenewSourceDefault.IfOnly : ControlUtils.RenewSourceDefault.None, !updateSort); if (updateSort && DeliveryAncmtList.SelectedItem != null) DeliveryAncmtList.ScrollIntoView(DeliveryAncmtList.SelectedItem); + + ViewModel.StatusAncmts = $"{deliveryAncmts.Count:N0}"; + ViewModel.StatusWeight = $"{deliveryAncmts.Sum(a => a.Weight):N0} kg"; } private async Task RefreshInputs(bool validate = false) {