PaymentVariantsWindow: Implement SeasonLock
This commit is contained in:
@ -19,6 +19,7 @@ namespace Elwig.Windows {
|
||||
public partial class PaymentVariantsWindow : ContextWindow {
|
||||
|
||||
public readonly int Year;
|
||||
public readonly bool SeasonLocked;
|
||||
private bool DataValid, DataChanged, NameChanged, CommentChanged, TransferDateValid, TransferDateChanged;
|
||||
|
||||
private static readonly JsonSerializerOptions JsonOpt = new() { WriteIndented = true };
|
||||
@ -26,6 +27,7 @@ namespace Elwig.Windows {
|
||||
public PaymentVariantsWindow(int year) {
|
||||
InitializeComponent();
|
||||
Year = year;
|
||||
SeasonLocked = Context.Seasons.Find(Year + 1) != null;
|
||||
Title = $"Auszahlungsvarianten - Lese {Year} - Elwig";
|
||||
if (!App.Config.Debug) {
|
||||
DataInput.Visibility = Visibility.Hidden;
|
||||
@ -42,9 +44,9 @@ namespace Elwig.Windows {
|
||||
var locked = !v.TestVariant;
|
||||
DeleteButton.IsEnabled = !locked;
|
||||
CalculateButton.IsEnabled = !locked;
|
||||
CommitButton.IsEnabled = !locked;
|
||||
CommitButton.IsEnabled = !locked && !SeasonLocked;
|
||||
CommitButton.Visibility = !locked ? Visibility.Visible : Visibility.Hidden;
|
||||
RevertButton.IsEnabled = locked;
|
||||
RevertButton.IsEnabled = locked && !SeasonLocked;
|
||||
RevertButton.Visibility = locked ? Visibility.Visible : Visibility.Hidden;
|
||||
Arrow3.Content = locked ? "\xF0B0" : "\xF0AF";
|
||||
CopyButton.IsEnabled = true;
|
||||
|
Reference in New Issue
Block a user