AreaComAdminWindow: Allow users to create new reeds inline

This commit is contained in:
2023-11-16 17:42:01 +01:00
parent 077e03ab2f
commit f4ec95cdca
12 changed files with 128 additions and 22 deletions

View File

@ -163,6 +163,13 @@ namespace Elwig.Helpers {
return c + 1;
}
public async Task<int> NextRdNr(int kgnr) {
int c = 0;
(await WbRde.Where(r => r.KgNr == kgnr).Select(r => r.RdNr).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))