DeliveryAncmtAdminWindow: Display stats in status bar
All checks were successful
Test / Run tests (push) Successful in 2m27s
All checks were successful
Test / Run tests (push) Successful in 2m27s
This commit is contained in:
@ -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<string>, IQueryable<DeliveryAncmt>, List<string>)> GetFilters(this DeliveryAncmtAdminViewModel vm, AppDbContext ctx) {
|
||||
|
@ -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]
|
||||
|
@ -307,9 +307,11 @@
|
||||
<ItemsPanelTemplate>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="120"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="150"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="200"/>
|
||||
<ColumnDefinition Width="1.125*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
@ -317,7 +319,27 @@
|
||||
</ItemsPanelTemplate>
|
||||
</StatusBar.ItemsPanel>
|
||||
<StatusBarItem>
|
||||
|
||||
<TextBlock>
|
||||
Anmeldungen: <Run Text="{Binding StatusAncmts}"/>
|
||||
</TextBlock>
|
||||
</StatusBarItem>
|
||||
<Separator Grid.Column="1"/>
|
||||
<StatusBarItem Grid.Column="2">
|
||||
<TextBlock>
|
||||
Gewicht: <Run Text="{Binding StatusWeight}"/>
|
||||
</TextBlock>
|
||||
</StatusBarItem>
|
||||
<Separator Grid.Column="3"/>
|
||||
<StatusBarItem Grid.Column="4">
|
||||
<TextBlock>
|
||||
Anmldg. erstellt: <Run Text="{Binding StatusAncmtCreated}"/>
|
||||
</TextBlock>
|
||||
</StatusBarItem>
|
||||
<Separator Grid.Column="5"/>
|
||||
<StatusBarItem Grid.Column="6">
|
||||
<TextBlock>
|
||||
Anmldg. geändert: <Run Text="{Binding StatusAncmtModified}"/>
|
||||
</TextBlock>
|
||||
</StatusBarItem>
|
||||
</StatusBar>
|
||||
</Grid>
|
||||
|
@ -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) {
|
||||
|
Reference in New Issue
Block a user