AdministrationWindow: Fix default value change check
This commit is contained in:
@ -119,7 +119,7 @@ namespace Elwig.Helpers {
|
||||
public async Task<int> NextMgNr() {
|
||||
int c = await Members.Select(m => m.MgNr).MinAsync();
|
||||
(await Members.OrderBy(m => m.MgNr).Select(m => m.MgNr).ToListAsync())
|
||||
.ForEach(a => { if (a <= c + 100) c = a; });
|
||||
.ForEach(a => { if (a <= c + 1000) c = a; });
|
||||
return c + 1;
|
||||
}
|
||||
|
||||
@ -134,21 +134,21 @@ namespace Elwig.Helpers {
|
||||
var dateStr = date.ToString("yyyy-MM-dd");
|
||||
int c = 0;
|
||||
(await Deliveries.Where(d => d.DateString == dateStr).Select(d => d.LNr).ToListAsync())
|
||||
.ForEach(a => { if (a <= c + 10) c = a; });
|
||||
.ForEach(a => { if (a <= c + 100) c = a; });
|
||||
return c + 1;
|
||||
}
|
||||
|
||||
public async Task<int> NextDId(int year) {
|
||||
int c = 0;
|
||||
(await Deliveries.Where(d => d.Year == year).Select(d => d.DId).ToListAsync())
|
||||
.ForEach(a => { if (a <= c + 10) c = a; });
|
||||
.ForEach(a => { if (a <= c + 100) c = a; });
|
||||
return c + 1;
|
||||
}
|
||||
|
||||
public async Task<int> NextDPNr(int year, int did) {
|
||||
int c = 0;
|
||||
(await DeliveryParts.Where(p => p.Year == year && p.DId == did).Select(d => d.DPNr).ToListAsync())
|
||||
.ForEach(a => { if (a <= c + 10) c = a; });
|
||||
.ForEach(a => { if (a <= c + 100) c = a; });
|
||||
return c + 1;
|
||||
}
|
||||
|
||||
|
@ -212,9 +212,9 @@ namespace Elwig.Helpers {
|
||||
} else if (input is Xceed.Wpf.Toolkit.CheckComboBox ccb) {
|
||||
return ccb.SelectedItems.Cast<object>().ToArray();
|
||||
} else if (input is CheckBox cb) {
|
||||
return cb.IsChecked;
|
||||
return (cb.IsChecked != null ? (cb.IsChecked == true ? bool.TrueString : bool.FalseString) : null);
|
||||
} else if (input is RadioButton rb) {
|
||||
return rb.IsChecked;
|
||||
return (rb.IsChecked != null ? (rb.IsChecked == true ? bool.TrueString : bool.FalseString) : null);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
@ -279,9 +279,9 @@ namespace Elwig.Windows {
|
||||
} else if (input is CheckComboBox ccb) {
|
||||
return !ccb.SelectedItems.Cast<object>().ToArray().SequenceEqual(((object[]?)DefaultValues[ccb]) ?? Array.Empty<object>());
|
||||
} else if (input is CheckBox cb) {
|
||||
return DefaultValues[cb] != (object?)cb.IsChecked;
|
||||
return (string?)DefaultValues[cb] != (cb.IsChecked != null ? (cb.IsChecked == true ? bool.TrueString : bool.FalseString) : null);
|
||||
} else if (input is RadioButton rb) {
|
||||
return DefaultValues[rb] != (object?)rb.IsChecked;
|
||||
return (string?)DefaultValues[rb] != (rb.IsChecked != null ? (rb.IsChecked == true ? bool.TrueString : bool.FalseString) : null);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user