MemberAdminWindow: Add pending member movement export

This commit is contained in:
lorenz.stechauner committed 2026-10-02 14:51:14 +02:00
1 parent 0e586cc438
commit 3944224e15
15 files changed
+354 -103

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
using Elwig.Models.Dtos;
using Elwig.Models.Entities;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
namespace Elwig.Helpers.Export {
public class MemberMovement : IExporter<MemberHistory> {
public static string FileExtension => "ods";
private readonly OdsFile _ods;
public MemberMovement(string filename) {
_ods = new OdsFile(filename);
}
public void Dispose() {
GC.SuppressFinalize(this);
_ods.Dispose();
}
public async Task ExportAsync(IEnumerable<MemberHistory> data, IProgress<double>? progress = null) {
using var ctx = new AppDbContext();
var tbl = MemberMovementData.FromMemberHistory("", data, await ctx.GetMemberHistory());
await _ods.AddTable(tbl);
}
}
}