ChartWindow: Automatically calculate variant when saved
All checks were successful
Test / Run tests (push) Successful in 1m40s

This commit is contained in:
2025-07-03 11:48:03 +02:00
parent 04761396e1
commit 4cc082d500
2 changed files with 7 additions and 1 deletions

View File

@@ -101,7 +101,7 @@
</ListBox.ItemTemplate>
</ListBox>
<Button x:Name="SaveButton" Content="Speichern" IsEnabled="False"
<Button x:Name="SaveButton" Content="Speichern &amp; Berechnen" IsEnabled="False"
HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="10,5,35,10" Grid.Column="0" Grid.Row="2"
Click="SaveButton_Click"/>

View File

@@ -651,6 +651,12 @@ namespace Elwig.Windows {
ctx.Update(PaymentVar);
await ctx.SaveChangesAsync();
}
try {
var b = new BillingVariant(PaymentVar.Year, PaymentVar.AvNr);
await b.Calculate();
} catch (Exception exc) {
MessageBox.Show(exc.Message, "Berechnungsfehler", MessageBoxButton.OK, MessageBoxImage.Error);
}
LockContext = false;
App.HintContextChange();
} catch (Exception exc) {