This commit is contained in:
1 parent
9e110a467a
commit
2cc58f8df6
24 files changed
+112
-125
No files matched your search
@@ -13,7 +13,7 @@ namespace Elwig.Dialogs {
|
||||
public partial class DeliverySplittingDialog : ContextWindow {
|
||||
|
||||
public class Row {
|
||||
public DeliveryPart Part { get; set; }
|
||||
public required DeliveryPart Part { get; set; }
|
||||
public bool SplitCompletely { get; set; }
|
||||
public string? SplitWeightString { get; set; }
|
||||
public int? SplitWeight {
|
||||
@@ -27,18 +27,18 @@ namespace Elwig.Dialogs {
|
||||
|
||||
public int? MgNr { get; set; }
|
||||
public string? LsNr { get; set; }
|
||||
public int[]? Weights => DeliveryParts.Select(r => r.SplitCompletely ? r.Part.Weight : r.SplitWeight ?? 0).ToArray();
|
||||
public int[]? Weights => [.. DeliveryParts.Select(r => r.SplitCompletely ? r.Part.Weight : r.SplitWeight ?? 0)];
|
||||
|
||||
public ObservableCollection<Row> DeliveryParts { get; set; }
|
||||
|
||||
public DeliverySplittingDialog(Delivery d) {
|
||||
_delivery = d;
|
||||
DeliveryParts = new(d.Parts.Select(p => new Row {
|
||||
DeliveryParts = [with([.. d.Parts.Select(p => new Row {
|
||||
Part = p,
|
||||
SplitCompletely = false,
|
||||
SplitWeight = null,
|
||||
SplitWeightEnabled = true,
|
||||
}).ToList());
|
||||
})])];
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user