Small fixes and additions in Helpers
This commit is contained in:
@ -123,11 +123,17 @@ namespace Elwig.Helpers {
|
||||
}
|
||||
|
||||
public async Task<int> NextDId(int year) {
|
||||
return await Deliveries.Where(d => d.Year == year).Select(d => d.DId).MaxAsync() + 1;
|
||||
int c = 0;
|
||||
(await Deliveries.Where(d => d.Year == year).Select(d => d.DId).ToListAsync())
|
||||
.ForEach(a => { if (a <= c + 10) c = a; });
|
||||
return c + 1;
|
||||
}
|
||||
|
||||
public async Task<int> NextDPNr(int year, int did) {
|
||||
return await DeliveryParts.Where(p => p.Year == year && p.DId == did).Select(d => d.DPNr).MaxAsync() + 1;
|
||||
int c = 0;
|
||||
(await DeliveryParts.Where(p => p.Year == year && p.DId == did).Select(d => d.DPNr).ToListAsync())
|
||||
.ForEach(a => { if (a <= c + 10) c = a; });
|
||||
return c + 1;
|
||||
}
|
||||
|
||||
public async Task<WineQualLevel> GetWineQualityLevel(double kmw) {
|
||||
|
Reference in New Issue
Block a user