DataTable: Add units for columns

This commit is contained in:
2023-11-15 18:29:14 +01:00
parent 486655d071
commit b096163ed3
7 changed files with 125 additions and 92 deletions

View File

@ -7,17 +7,16 @@ using System.Threading.Tasks;
namespace Elwig.Models.Dtos {
public class DeliveryConfirmationData : DataTable<DeliveryConfirmationRow> {
private static readonly (string, string)[] FieldNames = new[] {
("LsNr", "LsNr."),
("DPNr", "Pos."),
("Variant", "Sorte"),
("Attribute", "Attribut"),
("Modifiers", "Zu-/Abschläge"),
("QualityLevel", "Qualitätsstufe"),
("Oe", "°Oe"),
("Kmw", "°KMW"),
("Buckets", "Flächenbindung"),
("Weight", "Gewicht"),
private static readonly (string, string, string?, int)[] FieldNames = new[] {
("LsNr", "LsNr.", null, 26),
("DPNr", "Pos.", null, 8),
("Variant", "Sorte", null, 40),
("Attribute", "Attribut", null, 20),
("Modifiers", "Zu-/Abschläge", null, 30),
("QualityLevel", "Qualitätsstufe", null, 25),
("Gradation", "Gradation", "°Oe|°KMW", 32),
("Buckets", "Flächenbindung", "|kg", 36),
("Weight", "Gewicht", "kg", 16),
};
private readonly int MgNr;
@ -71,11 +70,10 @@ namespace Elwig.Models.Dtos {
public string Variant;
public string? Attribute;
public string QualityLevel;
public double Oe;
public double Kmw;
public (double Oe, double Kmw) Gradation;
public string[] Modifiers;
public int Weight;
public (string, int)[] Buckets;
public (string Name, int Value)[] Buckets;
public DeliveryConfirmationRow(DeliveryPart p) {
var d = p.Delivery;
@ -84,8 +82,7 @@ namespace Elwig.Models.Dtos {
Variant = p.Variant.Name;
Attribute = p.Attribute?.Name;
QualityLevel = p.Quality.Name;
Oe = p.Oe;
Kmw = p.Kmw;
Gradation = (p.Oe, p.Kmw);
Modifiers = p.Modifiers
.Select(m => m.Name)
.ToArray();