DeliveryAdminWindow: Fix ModifierInput source
All checks were successful
Test / Run tests (push) Successful in 1m45s
All checks were successful
Test / Run tests (push) Successful in 1m45s
This commit is contained in:
@ -1067,7 +1067,7 @@ namespace Elwig.Windows {
|
|||||||
|
|
||||||
await RefreshDeliveryList();
|
await RefreshDeliveryList();
|
||||||
var d = DeliveryList.SelectedItem as Delivery;
|
var d = DeliveryList.SelectedItem as Delivery;
|
||||||
var y = d?.Year ?? Utils.CurrentLastSeason;
|
var y = d?.Year ?? SeasonInput.Value;
|
||||||
ControlUtils.RenewItemsSource(MemberInput, await ctx.Members
|
ControlUtils.RenewItemsSource(MemberInput, await ctx.Members
|
||||||
.Where(m => m.IsActive || !IsCreating)
|
.Where(m => m.IsActive || !IsCreating)
|
||||||
.Include(m => m.PostalDest.AtPlz!.Ort)
|
.Include(m => m.PostalDest.AtPlz!.Ort)
|
||||||
@ -1084,7 +1084,11 @@ namespace Elwig.Windows {
|
|||||||
cultList.Insert(0, new NullItem(""));
|
cultList.Insert(0, new NullItem(""));
|
||||||
ControlUtils.RenewItemsSource(CultivationInput, cultList, null, ControlUtils.RenewSourceDefault.First);
|
ControlUtils.RenewItemsSource(CultivationInput, cultList, null, ControlUtils.RenewSourceDefault.First);
|
||||||
ControlUtils.RenewItemsSource(WineQualityLevelInput, await ctx.WineQualityLevels.ToListAsync());
|
ControlUtils.RenewItemsSource(WineQualityLevelInput, await ctx.WineQualityLevels.ToListAsync());
|
||||||
ControlUtils.RenewItemsSource(ModifiersInput, await ctx.Modifiers.Where(m => m.Year == y).OrderBy(m => m.Ordering).ToListAsync());
|
ControlUtils.RenewItemsSource(ModifiersInput, await ctx.Modifiers
|
||||||
|
.Where(m => m.Year == y)
|
||||||
|
.OrderBy(m => m.Ordering)
|
||||||
|
.Include(m => m.Season.Currency)
|
||||||
|
.ToListAsync());
|
||||||
ControlUtils.RenewItemsSource(WineOriginInput, (await ctx.WineOrigins.ToListAsync()).OrderByDescending(o => o.SortKey).ThenBy(o => o.HkId));
|
ControlUtils.RenewItemsSource(WineOriginInput, (await ctx.WineOrigins.ToListAsync()).OrderByDescending(o => o.SortKey).ThenBy(o => o.HkId));
|
||||||
var kgList = (await ctx.Katastralgemeinden
|
var kgList = (await ctx.Katastralgemeinden
|
||||||
.Where(k => k.WbKg != null)
|
.Where(k => k.WbKg != null)
|
||||||
@ -1112,10 +1116,18 @@ namespace Elwig.Windows {
|
|||||||
private async Task RefreshDeliveryParts() {
|
private async Task RefreshDeliveryParts() {
|
||||||
using var ctx = new AppDbContext();
|
using var ctx = new AppDbContext();
|
||||||
if (DeliveryList.SelectedItem is Delivery d) {
|
if (DeliveryList.SelectedItem is Delivery d) {
|
||||||
ControlUtils.RenewItemsSource(ModifiersInput, await ctx.Modifiers.Where(m => m.Year == d.Year).OrderBy(m => m.Ordering).ToListAsync());
|
ControlUtils.RenewItemsSource(ModifiersInput, await ctx.Modifiers
|
||||||
|
.Where(m => m.Year == d.Year)
|
||||||
|
.OrderBy(m => m.Ordering)
|
||||||
|
.Include(m => m.Season.Currency)
|
||||||
|
.ToListAsync());
|
||||||
ControlUtils.RenewItemsSource(DeliveryPartList, d.FilteredParts.OrderBy(p => p.DPNr).ToList(), DeliveryPartList_SelectionChanged, ControlUtils.RenewSourceDefault.First);
|
ControlUtils.RenewItemsSource(DeliveryPartList, d.FilteredParts.OrderBy(p => p.DPNr).ToList(), DeliveryPartList_SelectionChanged, ControlUtils.RenewSourceDefault.First);
|
||||||
} else {
|
} else {
|
||||||
ControlUtils.RenewItemsSource(ModifiersInput, await ctx.Modifiers.Where(m => m.Year == Utils.CurrentLastSeason).OrderBy(m => m.Ordering).ToListAsync());
|
ControlUtils.RenewItemsSource(ModifiersInput, await ctx.Modifiers
|
||||||
|
.Where(m => m.Year == SeasonInput.Value)
|
||||||
|
.OrderBy(m => m.Ordering)
|
||||||
|
.Include(m => m.Season.Currency)
|
||||||
|
.ToListAsync());
|
||||||
DeliveryPartList.ItemsSource = null;
|
DeliveryPartList.ItemsSource = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user