MemberDataSheet: Fix bugs
This commit is contained in:
@ -7,7 +7,7 @@ namespace Elwig.Documents {
|
|||||||
public class MemberDataSheet : BusinessDocument {
|
public class MemberDataSheet : BusinessDocument {
|
||||||
|
|
||||||
public Season Season;
|
public Season Season;
|
||||||
public int Year = 2023;
|
public int Year = Utils.CurrentYear;
|
||||||
public Dictionary<string, (string, int, int, int, int)> MemberBuckets;
|
public Dictionary<string, (string, int, int, int, int)> MemberBuckets;
|
||||||
public Dictionary<string, int> BucketAreas;
|
public Dictionary<string, int> BucketAreas;
|
||||||
|
|
||||||
|
@ -267,8 +267,12 @@ namespace Elwig.Helpers {
|
|||||||
while (await reader.ReadAsync()) {
|
while (await reader.ReadAsync()) {
|
||||||
var mgnr = reader.GetInt32(0);
|
var mgnr = reader.GetInt32(0);
|
||||||
var bucket = reader.GetString(1);
|
var bucket = reader.GetString(1);
|
||||||
|
var v = reader.GetInt32(2);
|
||||||
if (!buckets.ContainsKey(mgnr)) buckets[mgnr] = new();
|
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();
|
if (ownCnx) await cnx.DisposeAsync();
|
||||||
|
Reference in New Issue
Block a user