DeliveryAdminWindow: Add export option for BKI

This commit is contained in:
2023-09-08 12:44:29 +02:00
parent f5f00a7739
commit bc6148624c
4 changed files with 29 additions and 7 deletions

View File

@ -6,7 +6,7 @@ using System;
namespace Elwig.Helpers.Export {
using Row = Tuple<(string, string?, string?, string?, string, int, string, int), (string, int, string, string, string, int, string, double, double)>;
using Row = Tuple<(string?, string?, string?, string?, string, int, string, int), (string, int, string, string, string, int, string, double, double)>;
public class Bki : Csv<Row> {
@ -38,7 +38,7 @@ namespace Elwig.Helpers.Export {
List<Row> rows = new();
while (await r.ReadAsync()) {
rows.Add(new(
(r.GetString(0), r.IsDBNull(1) ? null : r.GetString(1), r.IsDBNull(2) ? null : r.GetString(2), r.IsDBNull(3) ? null : r.GetString(3), r.GetString(4), r.GetInt32(5), r.GetString(6), r.GetInt32(7)),
(r.IsDBNull(0) ? null : r.GetString(0), r.IsDBNull(1) ? null : r.GetString(1), r.IsDBNull(2) ? null : r.GetString(2), r.IsDBNull(3) ? null : r.GetString(3), r.GetString(4), r.GetInt32(5), r.GetString(6), r.GetInt32(7)),
(r.GetString(8), r.GetInt32(9), r.GetString(10), r.GetString(11), r.GetString(12), r.GetInt32(13), r.GetString(14), r.GetDouble(15), r.GetDouble(16))
));
}

View File

@ -305,7 +305,7 @@ namespace Elwig.Helpers {
}
public static (string, string?) SplitName(string fullName, string? familyName) {
if (familyName == null) return (fullName, null);
if (familyName == null || familyName == "") return (fullName, null);
var p0 = fullName.ToLower().IndexOf(familyName.ToLower());
if (p0 == -1) return (fullName, null);
var p1 = fullName.IndexOf(" und ");