MemberAdminWIndow: add status bar
This commit is contained in:
@ -4,7 +4,7 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:Elwig.Windows"
|
xmlns:local="clr-namespace:Elwig.Windows"
|
||||||
Title="Mitglieder - Elwig" Height="670" Width="1250" MinHeight="600" MinWidth="1000"
|
Title="Mitglieder - Elwig" Height="700" Width="1250" MinHeight="650" MinWidth="1150"
|
||||||
Loaded="Window_Loaded">
|
Loaded="Window_Loaded">
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<Style TargetType="Label">
|
<Style TargetType="Label">
|
||||||
@ -37,6 +37,7 @@
|
|||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="19"/>
|
<RowDefinition Height="19"/>
|
||||||
<RowDefinition Height="1*"/>
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="24"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="1*" MinWidth="300"/>
|
<ColumnDefinition Width="1*" MinWidth="300"/>
|
||||||
@ -67,7 +68,7 @@
|
|||||||
</MenuItem>
|
</MenuItem>
|
||||||
</Menu>
|
</Menu>
|
||||||
|
|
||||||
<Grid Grid.RowSpan="5" Grid.Row="1" Margin="5,0,0,0">
|
<Grid Grid.Row="1" Margin="5,0,0,0">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="39"/>
|
<RowDefinition Height="39"/>
|
||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
@ -386,10 +387,6 @@
|
|||||||
Checked="CheckBox_Changed" Unchecked="CheckBox_Changed"
|
Checked="CheckBox_Changed" Unchecked="CheckBox_Changed"
|
||||||
HorizontalAlignment="Left" Margin="60,225,0,0" VerticalAlignment="Top" Grid.Column="1" Grid.ColumnSpan="2"/>
|
HorizontalAlignment="Left" Margin="60,225,0,0" VerticalAlignment="Top" Grid.Column="1" Grid.ColumnSpan="2"/>
|
||||||
|
|
||||||
<Label Content="Gebundene Fläche:" Margin="10,250,0,0" Grid.Column="0"/>
|
|
||||||
<TextBlock x:Name="AreaCommitment" Text="- m²"
|
|
||||||
Grid.Column="1" HorizontalAlignment="Stretch" Margin="5,252,5,0" TextWrapping="NoWrap" VerticalAlignment="Top" FontSize="14" TextAlignment="Right"/>
|
|
||||||
|
|
||||||
<Button x:Name="DeliveryButton" Content="Lieferungen" Click="DeliveryButton_Click" IsEnabled="False"
|
<Button x:Name="DeliveryButton" Content="Lieferungen" Click="DeliveryButton_Click" IsEnabled="False"
|
||||||
HorizontalAlignment="Right" Margin="10,00,10,37" Width="150" VerticalAlignment="Bottom" Grid.ColumnSpan="3"/>
|
HorizontalAlignment="Right" Margin="10,00,10,37" Width="150" VerticalAlignment="Bottom" Grid.ColumnSpan="3"/>
|
||||||
<Button x:Name="AreaCommitmentButton" Content="Flächenbindungen" Click="AreaCommitmentButton_Click" IsEnabled="False"
|
<Button x:Name="AreaCommitmentButton" Content="Flächenbindungen" Click="AreaCommitmentButton_Click" IsEnabled="False"
|
||||||
@ -397,5 +394,44 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
<StatusBar Grid.Row="5" Grid.ColumnSpan="3" BorderThickness="0,1,0,0" BorderBrush="Gray">
|
||||||
|
<StatusBar.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="150"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="200"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="3*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="3*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
</Grid>
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</StatusBar.ItemsPanel>
|
||||||
|
<StatusBarItem>
|
||||||
|
<TextBlock Name="StatusMembers" Text="Mitglieder: -"/>
|
||||||
|
</StatusBarItem>
|
||||||
|
<Separator Grid.Column="1"/>
|
||||||
|
<StatusBarItem Grid.Column="2">
|
||||||
|
<TextBlock Name="StatusBusinessShares" Text="Geschäftsanteile: -"/>
|
||||||
|
</StatusBarItem>
|
||||||
|
<Separator Grid.Column="3"/>
|
||||||
|
<StatusBarItem Grid.Column="4">
|
||||||
|
<TextBlock Name="StatusAreaCommitment" Text="Gebundene Fläche: -"/>
|
||||||
|
</StatusBarItem>
|
||||||
|
<Separator Grid.Column="5"/>
|
||||||
|
<StatusBarItem Grid.Column="6">
|
||||||
|
<TextBlock Name="StatusDeliveriesLastSeason" Text="Lieferungen (letzte Saison): -"/>
|
||||||
|
</StatusBarItem>
|
||||||
|
<Separator Grid.Column="7"/>
|
||||||
|
<StatusBarItem Grid.Column="8">
|
||||||
|
<TextBlock Name="StatusDeliveriesThisSeason" Text="Lieferungen (aktuelle Saison): -"/>
|
||||||
|
</StatusBarItem>
|
||||||
|
</StatusBar>
|
||||||
</Grid>
|
</Grid>
|
||||||
</local:AdministrationWindow>
|
</local:AdministrationWindow>
|
||||||
|
@ -140,6 +140,8 @@ namespace Elwig.Windows {
|
|||||||
ControlUtils.RenewItemsSource(BranchInput, await Context.Branches.OrderBy(b => b.Name).ToListAsync(), i => (i as Branch)?.ZwstId);
|
ControlUtils.RenewItemsSource(BranchInput, await Context.Branches.OrderBy(b => b.Name).ToListAsync(), i => (i as Branch)?.ZwstId);
|
||||||
ControlUtils.RenewItemsSource(DefaultKgInput, await Context.WbKgs.Select(k => k.AtKg).OrderBy(k => k.Name).ToListAsync(), i => (i as AT_Kg)?.KgNr);
|
ControlUtils.RenewItemsSource(DefaultKgInput, await Context.WbKgs.Select(k => k.AtKg).OrderBy(k => k.Name).ToListAsync(), i => (i as AT_Kg)?.KgNr);
|
||||||
await RefreshMemberList();
|
await RefreshMemberList();
|
||||||
|
StatusMembers.Text = $"Mitglieder: {await Context.Members.CountAsync(m => m.IsActive):N0} ({await Context.Members.CountAsync():N0})";
|
||||||
|
StatusBusinessShares.Text = $"Geschäftsanteile: {await Context.Members.SumAsync(m => m.BusinessShares):N0}";
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetPhoneNrInput(int nr, string? type, string? number, string? comment) {
|
private void SetPhoneNrInput(int nr, string? type, string? number, string? comment) {
|
||||||
@ -592,7 +594,11 @@ namespace Elwig.Windows {
|
|||||||
ContactPostalInput.IsChecked = m.ContactViaPost;
|
ContactPostalInput.IsChecked = m.ContactViaPost;
|
||||||
ContactEmailInput.IsChecked = m.ContactViaEmail;
|
ContactEmailInput.IsChecked = m.ContactViaEmail;
|
||||||
|
|
||||||
AreaCommitment.Text = $"{m.ActiveAreaCommitments.Select(c => c.Area).Sum():N0} m²";
|
var d1 = Context.Deliveries.Where(d => d.Year == Utils.CurrentLastSeason && d.MgNr == m.MgNr);
|
||||||
|
var d2 = Context.Deliveries.Where(d => d.Year == Utils.CurrentLastSeason - 1 && d.MgNr == m.MgNr);
|
||||||
|
StatusDeliveriesLastSeason.Text = $"Lieferungen ({Utils.CurrentLastSeason - 1}): {d2.Count():N0} ({d2.Sum(d => d.Parts.Count):N0}), {d2.SelectMany(d => d.Parts).Sum(p => p.Weight):N0} kg";
|
||||||
|
StatusDeliveriesThisSeason.Text = $"Lieferungen ({Utils.CurrentLastSeason}): {d1.Count():N0} ({d1.Sum(d => d.Parts.Count):N0}), {d1.SelectMany(d => d.Parts).Sum(p => p.Weight):N0} kg";
|
||||||
|
StatusAreaCommitment.Text = $"Gebundene Fläche: {m.ActiveAreaCommitments.Select(c => c.Area).Sum():N0} m²";
|
||||||
|
|
||||||
Menu_Member_SendEmail.IsEnabled = m.EmailAddresses.Count > 0;
|
Menu_Member_SendEmail.IsEnabled = m.EmailAddresses.Count > 0;
|
||||||
|
|
||||||
@ -601,7 +607,9 @@ namespace Elwig.Windows {
|
|||||||
|
|
||||||
new protected void ClearInputs(bool validate = false) {
|
new protected void ClearInputs(bool validate = false) {
|
||||||
Menu_Member_SendEmail.IsEnabled = false;
|
Menu_Member_SendEmail.IsEnabled = false;
|
||||||
AreaCommitment.Text = "- m²";
|
StatusDeliveriesLastSeason.Text = $"Lieferungen ({Utils.CurrentLastSeason - 1}): -";
|
||||||
|
StatusDeliveriesThisSeason.Text = $"Lieferungen ({Utils.CurrentLastSeason}): -";
|
||||||
|
StatusAreaCommitment.Text = "Gebundene Fläche: -";
|
||||||
Age.Text = "-";
|
Age.Text = "-";
|
||||||
base.ClearInputs(validate);
|
base.ClearInputs(validate);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user