MemberDataSheet: Fix bugs

This commit is contained in:
2023-11-30 02:00:44 +01:00
parent 8b9d62ea50
commit 59553be571
2 changed files with 6 additions and 2 deletions

View File

@ -7,7 +7,7 @@ namespace Elwig.Documents {
public class MemberDataSheet : BusinessDocument {
public Season Season;
public int Year = 2023;
public int Year = Utils.CurrentYear;
public Dictionary<string, (string, int, int, int, int)> MemberBuckets;
public Dictionary<string, int> BucketAreas;

View File

@ -267,8 +267,12 @@ namespace Elwig.Helpers {
while (await reader.ReadAsync()) {
var mgnr = reader.GetInt32(0);
var bucket = reader.GetString(1);
var v = reader.GetInt32(2);
if (!buckets.ContainsKey(mgnr)) buckets[mgnr] = new();
buckets[mgnr][bucket] = reader.GetInt32(2);
buckets[mgnr][bucket] = v;
if (bucket.Length > 2) {
buckets[mgnr][bucket[..2]] = buckets[mgnr].GetValueOrDefault(bucket[..2], 0) + v;
}
}
}
if (ownCnx) await cnx.DisposeAsync();