This commit is contained in:
1 parent
bc419ce57a
commit
065fbc2eea
16 files changed
+161
-53
No files matched your search
@@ -24,6 +24,7 @@ namespace Elwig.Windows {
|
||||
BranchIdInput, BranchNameInput, BranchPlzInput, BranchOrtInput,
|
||||
BranchAddressInput, BranchPhoneNrInput, BranchFaxNrInput, BranchMobileNrInput,
|
||||
WineAttributeIdInput, WineAttributeNameInput, WineAttributeActiveInput,
|
||||
WineAttributeMinQualityLevelInput, WineAttributeMaxQualityLevelInput,
|
||||
WineAttributeMaxKgPerHaInput, WineAttributeStrictInput, WineAttributeFillLowerInput,
|
||||
WineCultivationIdInput, WineCultivationNameInput, WineCultivationDescriptionInput, WineCultivationOrganicInput,
|
||||
AreaCommitmentTypeIdInput, AreaCommitmentTypeWineVariantInput, AreaCommitmentTypeWineAttributeInput,
|
||||
@@ -60,6 +61,8 @@ namespace Elwig.Windows {
|
||||
WineAttributeIdInput.IsReadOnly = true;
|
||||
WineAttributeNameInput.IsReadOnly = true;
|
||||
WineAttributeActiveInput.IsEnabled = false;
|
||||
WineAttributeMinQualityLevelInput.IsEnabled = false;
|
||||
WineAttributeMaxQualityLevelInput.IsEnabled = false;
|
||||
WineAttributeMaxKgPerHaInput.IsReadOnly = true;
|
||||
WineAttributeStrictInput.IsEnabled = false;
|
||||
WineAttributeFillLowerInput.IsEnabled = false;
|
||||
@@ -109,6 +112,8 @@ namespace Elwig.Windows {
|
||||
WineAttributeIdInput.IsReadOnly = false;
|
||||
WineAttributeNameInput.IsReadOnly = false;
|
||||
WineAttributeActiveInput.IsEnabled = true;
|
||||
WineAttributeMinQualityLevelInput.IsEnabled = true;
|
||||
WineAttributeMaxQualityLevelInput.IsEnabled = true;
|
||||
WineAttributeMaxKgPerHaInput.IsReadOnly = false;
|
||||
WineAttributeStrictInput.IsEnabled = true;
|
||||
WineAttributeFillLowerInput.IsEnabled = true;
|
||||
@@ -145,20 +150,30 @@ namespace Elwig.Windows {
|
||||
|
||||
protected override async Task OnRenewContext(AppDbContext ctx) {
|
||||
await base.OnRenewContext(ctx);
|
||||
FillInputs(App.Client, await ctx.FetchSeasons(Utils.CurrentLastSeason).SingleOrDefaultAsync());
|
||||
ControlUtils.RenewItemsSource(SeasonList, await ctx.FetchSeasons(includeModifiers: true).ToListAsync(), null, ControlUtils.RenewSourceDefault.First);
|
||||
var year = (SeasonList.SelectedItem as Season)?.Year;
|
||||
ControlUtils.RenewItemsSource(BranchList, await ctx.FetchBranches().ToListAsync(), null, ControlUtils.RenewSourceDefault.First);
|
||||
ControlUtils.RenewItemsSource(WineAttributeList, await ctx.FetchWineAttributes().ToListAsync(), null, ControlUtils.RenewSourceDefault.First);
|
||||
|
||||
var qualList = await ctx.FetchWineQualityLevels(includePredicate: false).Cast<object>().ToListAsync();
|
||||
var fullQualList = await ctx.FetchWineQualityLevels().Cast<object>().ToListAsync();
|
||||
qualList.Insert(0, new NullItem("- Keine -"));
|
||||
fullQualList.Insert(0, new NullItem("- Keine -"));
|
||||
ControlUtils.RenewItemsSource(WineAttributeMinQualityLevelInput, fullQualList);
|
||||
ControlUtils.RenewItemsSource(WineAttributeMaxQualityLevelInput, fullQualList);
|
||||
ControlUtils.RenewItemsSource(ParameterReceiptMaxQualityLevelInput, qualList);
|
||||
ControlUtils.RenewItemsSource(AreaCommitmentTypeWineVariantInput, await ctx.FetchWineVarieties().ToListAsync());
|
||||
var attrList = await ctx.FetchWineAttributes().Cast<object>().ToListAsync();
|
||||
attrList.Insert(0, new NullItem(""));
|
||||
ControlUtils.RenewItemsSource(AreaCommitmentTypeWineAttributeInput, attrList);
|
||||
|
||||
ControlUtils.RenewItemsSource(SeasonList, await ctx.FetchSeasons(includeModifiers: true).ToListAsync(), null, ControlUtils.RenewSourceDefault.First);
|
||||
var year = (SeasonList.SelectedItem as Season)?.Year;
|
||||
ControlUtils.RenewItemsSource(BranchList, await ctx.FetchBranches().ToListAsync(), null, ControlUtils.RenewSourceDefault.First);
|
||||
ControlUtils.RenewItemsSource(WineAttributeList, await ctx.FetchWineAttributes().ToListAsync(), null, ControlUtils.RenewSourceDefault.First);
|
||||
ControlUtils.RenewItemsSource(AreaCommitmentTypeList, await ctx.AreaCommitmentTypes
|
||||
.OrderBy(t => t.VtrgId)
|
||||
.ToListAsync(), null, ControlUtils.RenewSourceDefault.First);
|
||||
ControlUtils.RenewItemsSource(WineCultivationList, await ctx.FetchWineCultivations().ToListAsync(), null, ControlUtils.RenewSourceDefault.First);
|
||||
ControlUtils.RenewItemsSource(SeasonModifierList, await ctx.FetchModifiers(year ?? 0).ToListAsync(), null, ControlUtils.RenewSourceDefault.First);
|
||||
|
||||
FillInputs(App.Client, await ctx.FetchSeasons(Utils.CurrentLastSeason).SingleOrDefaultAsync());
|
||||
}
|
||||
|
||||
protected override void UpdateButtons() {
|
||||
@@ -351,6 +366,7 @@ namespace Elwig.Windows {
|
||||
|
||||
ParameterBusinessShareModeInput.SelectedIndex = p.ModeBusinessShares;
|
||||
ParameterBusinessShareHistoryInput.IsChecked = p.EnableMemberHistory;
|
||||
ControlUtils.SelectItemWithPk(ParameterReceiptMaxQualityLevelInput, p.ReceiptMaxQualId);
|
||||
ParameterAllowAttrIntoLowerInput.IsChecked = s?.Billing_AllowAttrsIntoLower ?? false;
|
||||
ParameterAvoidUnderDeliveriesInput.IsChecked = s?.Billing_AvoidUnderDeliveries ?? false;
|
||||
ParameterHonorContractedInput.IsChecked = s?.Billing_HonorContracted ?? false;
|
||||
@@ -390,6 +406,7 @@ namespace Elwig.Windows {
|
||||
|
||||
p.ExportEbicsVersion = ParameterExportEbicsVersion.SelectedIndex + 3;
|
||||
p.ExportEbicsAddress = ParameterExportEbicsAddress.SelectedIndex;
|
||||
p.ReceiptMaxQualId = (ParameterReceiptMaxQualityLevelInput.SelectedItem as WineQualLevel)?.QualId;
|
||||
|
||||
await p.UpdateValues();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user