[#12] DeliveryAdminWindow: Improve filters

This commit is contained in:
2024-03-26 16:55:40 +01:00
parent 56ac79b4dd
commit e3cb20366c
2 changed files with 44 additions and 0 deletions

View File

@ -110,6 +110,10 @@
<Bold>Bewirtschaftung</Bold>: z.B. bio, !kip (alle außer KIP), ...<LineBreak/>
<Bold>Datum</Bold>: z.B. 1.9., 15.9.-10.10., -15.10.2020, ...<LineBreak/>
<Bold>Uhrzeit</Bold>: z.B. 06:00-08:00, 18:00-, ...<LineBreak/>
<Bold>Handwiegung</Bold>: handw[iegung], !Handw[iegung] (alle ohne Handwiegung)<LineBreak/>
<Bold>Handlese</Bold>: Handl[ese], !handl[ese] (alle ohne Handlese)<LineBreak/>
<Bold>Gebunden</Bold>: geb[unden], ungeb[unden], !geb[unden], !ungeb[unden]<LineBreak/>
<Bold>Brutto/Netto Wiegung</Bold>: bto, Brut[to], nto, Net[to], gerebelt, !Gerebelt<LineBreak/>
<Bold>Freitext</Bold>: z.B. Lieferscheinnummern, Anmerkung, "quw" (sucht nach dem Text "quw")
</TextBlock>
</TextBox.ToolTip>

View File

@ -401,6 +401,46 @@ namespace Elwig.Windows {
filterVar.AddRange(var.Values.Where(v => v.IsWhite).Select(v => v.SortId));
filter.RemoveAt(i--);
filterNames.Add("Weißweinsorten");
} else if (e.Length >= 3 && e.Length <= 8 && "gebunden".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
prd = prd.And(p => p.IsGebunden == true);
filter.RemoveAt(i--);
filterNames.Add("gebunden");
} else if (e.Length >= 4 && e.Length <= 9 && "!gebunden".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
prd = prd.And(p => p.IsGebunden == false);
filter.RemoveAt(i--);
filterNames.Add("ungebunden");
} else if (e.Length >= 5 && e.Length <= 10 && "ungebunden".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
prd = prd.And(p => p.IsGebunden == false);
filter.RemoveAt(i--);
filterNames.Add("ungebunden");
} else if (e.Length >= 6 && e.Length <= 11 && "!ungebunden".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
prd = prd.And(p => p.IsGebunden == true);
filter.RemoveAt(i--);
filterNames.Add("gebunden");
} else if (e.Length >= 5 && e.Length <= 8 && "handlese".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
prd = prd.And(p => p.IsHandPicked == true);
filter.RemoveAt(i--);
filterNames.Add("Handlese");
} else if (e.Length >= 6 && e.Length <= 9 && "!handlese".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
prd = prd.And(p => p.IsHandPicked == false);
filter.RemoveAt(i--);
filterNames.Add("keine Handlese");
} else if (e.Length >= 5 && e.Length <= 11 && "handwiegung".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
prd = prd.And(p => p.IsManualWeighing == true);
filter.RemoveAt(i--);
filterNames.Add("Handwiegung");
} else if (e.Length >= 6 && e.Length <= 12 && "!handwiegung".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
prd = prd.And(p => p.IsManualWeighing == false);
filter.RemoveAt(i--);
filterNames.Add("keine Handwiegung");
} else if (e.ToLower() is "bto" or "brut" or "brutt" or "brutto" or "!gerebelt") {
prd = prd.And(p => p.IsNetWeight == false);
filter.RemoveAt(i--);
filterNames.Add("brutto Wiegung");
} else if (e.ToLower() is "nto" or "net" or "nett" or "netto" or "gerebelt") {
prd = prd.And(p => p.IsNetWeight == true);
filter.RemoveAt(i--);
filterNames.Add("netto Wiegung");
} else if (e.Length == 2 && var.ContainsKey(e.ToUpper())) {
filterVar.Add(e.ToUpper());
filter.RemoveAt(i--);