ControlUtils: Cleanup SelectItem() method and use accordingly
This commit is contained in:
@ -137,33 +137,33 @@ namespace Elwig.Windows {
|
||||
FillInputs(App.Client);
|
||||
ControlUtils.RenewItemsSource(SeasonList, await ctx.Seasons
|
||||
.OrderByDescending(s => s.Year)
|
||||
.ToListAsync(), s => (s as Season)?.Year, null, ControlUtils.RenewSourceDefault.First);
|
||||
.ToListAsync(), null, ControlUtils.RenewSourceDefault.First);
|
||||
var year = (SeasonList.SelectedItem as Season)?.Year;
|
||||
ControlUtils.RenewItemsSource(BranchList, await ctx.Branches
|
||||
.OrderBy(b => b.Name)
|
||||
.Include(b => b.PostalDest!.AtPlz)
|
||||
.ToListAsync(), b => (b as Branch)?.ZwstId, null, ControlUtils.RenewSourceDefault.First);
|
||||
.ToListAsync(), null, ControlUtils.RenewSourceDefault.First);
|
||||
ControlUtils.RenewItemsSource(WineAttributeList, await ctx.WineAttributes
|
||||
.OrderBy(a => a.Name)
|
||||
.ToListAsync(), a => (a as WineAttr)?.AttrId, null, ControlUtils.RenewSourceDefault.First);
|
||||
.ToListAsync(), null, ControlUtils.RenewSourceDefault.First);
|
||||
ControlUtils.RenewItemsSource(AreaCommitmentTypeWineVariantInput, await ctx.WineVarieties
|
||||
.OrderBy(s => s.Name)
|
||||
.ToListAsync(), s => (s as WineVar)?.SortId);
|
||||
.ToListAsync());
|
||||
var attrList = await ctx.WineAttributes.OrderBy(a => a.Name).Cast<object>().ToListAsync();
|
||||
attrList.Insert(0, new NullItem(""));
|
||||
ControlUtils.RenewItemsSource(AreaCommitmentTypeWineAttributeInput, attrList, a => (a as WineAttr)?.AttrId);
|
||||
ControlUtils.RenewItemsSource(AreaCommitmentTypeWineAttributeInput, attrList);
|
||||
ControlUtils.RenewItemsSource(AreaCommitmentTypeList, await ctx.AreaCommitmentTypes
|
||||
.OrderBy(t => t.VtrgId)
|
||||
.Include(t => t.WineVar)
|
||||
.Include(t => t.WineAttr)
|
||||
.ToListAsync(), t => (t as AreaComType)?.VtrgId, null, ControlUtils.RenewSourceDefault.First);
|
||||
.ToListAsync(), null, ControlUtils.RenewSourceDefault.First);
|
||||
ControlUtils.RenewItemsSource(WineCultivationList, await ctx.WineCultivations
|
||||
.OrderBy(c => c.Name)
|
||||
.ToListAsync(), c=> (c as WineCult)?.CultId, null, ControlUtils.RenewSourceDefault.First);
|
||||
.ToListAsync(), null, ControlUtils.RenewSourceDefault.First);
|
||||
ControlUtils.RenewItemsSource(SeasonModifierList, await ctx.Modifiers
|
||||
.Where(m => m.Year == year)
|
||||
.OrderBy(m => m.Ordering)
|
||||
.ToListAsync(), m => (m as Modifier)?.ModId, null, ControlUtils.RenewSourceDefault.First);
|
||||
.ToListAsync(), null, ControlUtils.RenewSourceDefault.First);
|
||||
}
|
||||
|
||||
protected override void UpdateButtons() {
|
||||
|
Reference in New Issue
Block a user