Add AreaCommitment area to MemberListWindow

This commit is contained in:
2023-03-14 14:08:23 +01:00
parent 3614445cff
commit 0d8f62f404
9 changed files with 48 additions and 27 deletions

View File

@ -31,7 +31,7 @@
</Style>
<Style TargetType="Button">
<Setter Property="FontSize" Value="14"/>
<Setter Property="Padding" Value="3"/>
<Setter Property="Padding" Value="9,3"/>
<Setter Property="Height" Value="27"/>
</Style>
</Window.Resources>
@ -296,6 +296,10 @@
Checked="RadioButton_Changed" Unchecked="RadioButton_Changed"
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="Left" Margin="2,254,0,0" TextWrapping="NoWrap" VerticalAlignment="Top"/>
<Button x:Name="ContractButton" Content="Flächenbindungen" Click="ContractButton_Click"
HorizontalAlignment="Right" Margin="10,10,10,10" VerticalAlignment="Bottom" Grid.ColumnSpan="3"/>
</Grid>

View File

@ -175,7 +175,6 @@ namespace WGneu.Windows {
int newMgNr = int.Parse(MgNrInput.Text);
m.PredecessorMgNr = (PredecessorMgNrInput.Text == "") ? null : int.Parse(PredecessorMgNrInput.Text);
m.Predecessor = Context.Members.Find(m.PredecessorMgNr);
m.Prefix = (PrefixInput.Text == "") ? null : PrefixInput.Text;
m.GivenName = GivenNameInput.Text;
m.FamilyName = FamilyNameInput.Text;
@ -183,7 +182,6 @@ namespace WGneu.Windows {
m.Birthday = (BirthdayInput.Text == "") ? null : string.Join("-", BirthdayInput.Text.Split(".").Reverse());
m.CountryCode = "AT";
m.PostalDestId = ((AT_PlzDest)OrtInput.SelectedItem).Id;
m.PostalDest = Context.PostalDestinations.Find(m.CountryCode, m.PostalDestId);
m.Address = AddressInput.Text;
m.Email = (EmailInput.Text == "") ? null : EmailInput.Text;
@ -400,6 +398,8 @@ namespace WGneu.Windows {
case "email": ContactEmailInput.IsChecked = true; break;
}
AreaCommitment.Text = $"{m.Contracts.Select(c => c.Area).Sum():N0} m²";
Menu_Member_SendEmail.IsEnabled = m.Email != null;
FillOriginalValues();
@ -418,6 +418,7 @@ namespace WGneu.Windows {
private void ClearInputs() {
Menu_Member_SendEmail.IsEnabled = false;
AreaCommitment.Text = "- m²";
OriginalValues.Clear();
foreach (var tb in Utils.FindVisualChilds<TextBox>(this, ExemptInputs)) {
tb.Text = " ";