AreaComAdminWindow: Add - Keine Angabe - to wine cultivation list

This commit is contained in:
2024-02-25 18:44:18 +01:00
parent 0a42d4776a
commit 7181d744fc

View File

@ -156,7 +156,7 @@ namespace Elwig.Windows {
AreaInput.Text = a.Area.ToString(); AreaInput.Text = a.Area.ToString();
AreaComTypeInput.SelectedItem = a.AreaComType; AreaComTypeInput.SelectedItem = a.AreaComType;
WineCultivationInput.SelectedItem = a.WineCult; WineCultivationInput.SelectedItem = a.WineCult ?? WineCultivationInput.Items[0];
CommentInput.Text = a.Comment; CommentInput.Text = a.Comment;
@ -179,7 +179,9 @@ namespace Elwig.Windows {
await base.OnRenewContext(); await base.OnRenewContext();
ControlUtils.RenewItemsSource(KgInput, await Context.WbKgs.Select(k => k.AtKg).OrderBy(k => k.Name).ToListAsync(), i => (i as AT_Kg)?.KgNr); ControlUtils.RenewItemsSource(KgInput, await Context.WbKgs.Select(k => k.AtKg).OrderBy(k => k.Name).ToListAsync(), i => (i as AT_Kg)?.KgNr);
ControlUtils.RenewItemsSource(AreaComTypeInput, await Context.AreaCommitmentTypes.OrderBy(v => v.VtrgId).ToListAsync(), i => (i as AreaComType)?.VtrgId); ControlUtils.RenewItemsSource(AreaComTypeInput, await Context.AreaCommitmentTypes.OrderBy(v => v.VtrgId).ToListAsync(), i => (i as AreaComType)?.VtrgId);
ControlUtils.RenewItemsSource(WineCultivationInput, await Context.WineCultivations.OrderBy(c => c.Name).ToListAsync(), i => (i as WineCult)?.CultId); var cultList = await Context.WineCultivations.OrderBy(c => c.Name).Cast<object>().ToListAsync();
cultList.Insert(0, new NullItem());
ControlUtils.RenewItemsSource(WineCultivationInput, cultList, i => (i as WineCult)?.CultId);
await RefreshAreaCommitmentList(); await RefreshAreaCommitmentList();
} }