Compare commits

...

2 Commits

Author SHA1 Message Date
lorenz.stechauner 09a7889044 AppDbContext: Add NextAvNr() 2024-01-08 14:18:15 +01:00
lorenz.stechauner d77aac43ec App: Add FocusBaseDataSeason() 2024-01-08 14:17:56 +01:00
3 changed files with 16 additions and 1 deletions
+8
View File
@@ -17,6 +17,7 @@ using Elwig.Windows;
using Elwig.Dialogs;
using System.Threading.Tasks;
using Elwig.Helpers.Billing;
using Elwig.Models.Entities;
namespace Elwig {
public partial class App : Application {
@@ -221,6 +222,13 @@ namespace Elwig {
return w;
}
public static BaseDataWindow FocusBaseDataSeason(int year) {
var w = FocusBaseData();
w.Seasons.Focus();
ControlUtils.SelectListBoxItem(w.SeasonList, s => (s as Season)?.Year, year);
return w;
}
public static SeasonFinishWindow FocusSeasonFinish() {
return FocusWindow<SeasonFinishWindow>(() => new());
}
+7
View File
@@ -200,6 +200,13 @@ namespace Elwig.Helpers {
return c + 1;
}
public async Task<int> NextAvNr(int year) {
int c = 0;
(await PaymentVariants.Where(v => v.Year == year).Select(v => v.AvNr).ToListAsync())
.ForEach(a => { if (a <= c + 100) c = a; });
return c + 1;
}
public async Task<WineQualLevel> GetWineQualityLevel(double kmw) {
return await WineQualityLevels
.Where(q => !q.IsPredicate && (q.MinKmw == null || q.MinKmw <= kmw))
+1 -1
View File
@@ -375,7 +375,7 @@
</Grid>
</TabItem>
<TabItem Header="Saisons">
<TabItem Header="Saisons" x:Name="Seasons">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180"/>