Add status bar in DeliveryAdminWindow

This commit is contained in:
2023-08-20 00:05:20 +02:00
parent f735da0059
commit 8534ff6bba
4 changed files with 154 additions and 26 deletions

View File

@ -84,20 +84,13 @@ namespace Elwig.Models {
public string SortIdString => string.Join(", ", SortIds);
public double Kmw => Parts.Aggregate(
(Weight: 0, Kmw: 0.0),
(sum, item) => (
sum.Weight + item.Weight,
(sum.Kmw * sum.Weight + item.Kmw * item.Weight) / (sum.Weight + item.Weight)
),
sum => sum.Kmw
);
public double Kmw => Utils.AggregateDeliveryPartsKmw(Parts);
public double Oe => Utils.KmwToOe(Kmw);
public int SearchScore(IEnumerable<string> keywords) {
var list = new string?[] {
LsNr, Date.ToString("dd.MM.yyyy"), Time?.ToString("HH:mm"),
LsNr, Time?.ToString("HH:mm"),
Member.FamilyName, Member.MiddleName, Member.GivenName, Member.BillingAddress?.Name,
Comment
}.ToList();