DeliveryAdminWindow: Add branch name in title for übernahme mode
This commit is contained in:
@ -26,7 +26,7 @@ namespace Elwig.Windows {
|
|||||||
private bool IsUpdatingGradation = false;
|
private bool IsUpdatingGradation = false;
|
||||||
private Member? Member = null;
|
private Member? Member = null;
|
||||||
private readonly DispatcherTimer Timer;
|
private readonly DispatcherTimer Timer;
|
||||||
private List<string> TextFilter = new();
|
private List<string> TextFilter = [];
|
||||||
private readonly RoutedCommand CtrlF = new();
|
private readonly RoutedCommand CtrlF = new();
|
||||||
|
|
||||||
private string? LastScaleError = null;
|
private string? LastScaleError = null;
|
||||||
@ -39,22 +39,22 @@ namespace Elwig.Windows {
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
CtrlF.InputGestures.Add(new KeyGesture(Key.F, ModifierKeys.Control));
|
CtrlF.InputGestures.Add(new KeyGesture(Key.F, ModifierKeys.Control));
|
||||||
CommandBindings.Add(new CommandBinding(CtrlF, FocusSearchInput));
|
CommandBindings.Add(new CommandBinding(CtrlF, FocusSearchInput));
|
||||||
RequiredInputs = new Control[] {
|
RequiredInputs = [
|
||||||
MgNrInput, MemberInput,
|
MgNrInput, MemberInput,
|
||||||
LsNrInput, DateInput, BranchInput,
|
LsNrInput, DateInput, BranchInput,
|
||||||
SortIdInput, WineVarietyInput,
|
SortIdInput, WineVarietyInput,
|
||||||
GradationOeInput.TextBox, GradationKmwInput.TextBox, WineQualityLevelInput,
|
GradationOeInput.TextBox, GradationKmwInput.TextBox, WineQualityLevelInput,
|
||||||
WineOriginInput, WineKgInput,
|
WineOriginInput, WineKgInput,
|
||||||
WeightInput.TextBox
|
WeightInput.TextBox
|
||||||
};
|
];
|
||||||
ExemptInputs = new Control[] {
|
ExemptInputs = [
|
||||||
SearchInput, SeasonInput, TodayOnlyInput, AllSeasonsInput,
|
SearchInput, SeasonInput, TodayOnlyInput, AllSeasonsInput,
|
||||||
DeliveryList, DeliveryPartList,
|
DeliveryList, DeliveryPartList,
|
||||||
MemberAddressField,
|
MemberAddressField,
|
||||||
};
|
];
|
||||||
WeighingButtons = new Button[] {
|
WeighingButtons = [
|
||||||
WeighingAButton, WeighingBButton, WeighingCButton, WeighingDButton,
|
WeighingAButton, WeighingBButton, WeighingCButton, WeighingDButton,
|
||||||
};
|
];
|
||||||
IsReceipt = receipt;
|
IsReceipt = receipt;
|
||||||
|
|
||||||
Timer = new DispatcherTimer();
|
Timer = new DispatcherTimer();
|
||||||
@ -68,7 +68,7 @@ namespace Elwig.Windows {
|
|||||||
DoShowWarningWindows = false;
|
DoShowWarningWindows = false;
|
||||||
|
|
||||||
if (IsReceipt) {
|
if (IsReceipt) {
|
||||||
Title = "Übernahme - Elwig";
|
Title = $"Übernahme - {App.BranchName} - Elwig";
|
||||||
TodayOnlyInput.IsChecked = true;
|
TodayOnlyInput.IsChecked = true;
|
||||||
var n = App.Scales.Count;
|
var n = App.Scales.Count;
|
||||||
if (n < 1) WeighingAButton.Visibility = Visibility.Hidden;
|
if (n < 1) WeighingAButton.Visibility = Visibility.Hidden;
|
||||||
@ -297,7 +297,7 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async Task<(List<string>, IQueryable<Delivery>, IQueryable<DeliveryPart>, List<string>)> GetFilters() {
|
private async Task<(List<string>, IQueryable<Delivery>, IQueryable<DeliveryPart>, List<string>)> GetFilters() {
|
||||||
List<string> filterNames = new();
|
List<string> filterNames = [];
|
||||||
IQueryable<Delivery> deliveryQuery = Context.Deliveries;
|
IQueryable<Delivery> deliveryQuery = Context.Deliveries;
|
||||||
if (IsReceipt && App.BranchNum > 1) {
|
if (IsReceipt && App.BranchNum > 1) {
|
||||||
deliveryQuery = deliveryQuery.Where(d => d.ZwstId == App.ZwstId);
|
deliveryQuery = deliveryQuery.Where(d => d.ZwstId == App.ZwstId);
|
||||||
@ -358,10 +358,10 @@ namespace Elwig.Windows {
|
|||||||
filterQual.Add(e.ToUpper());
|
filterQual.Add(e.ToUpper());
|
||||||
filter.RemoveAt(i--);
|
filter.RemoveAt(i--);
|
||||||
filterNames.Add(qual[e.ToUpper()].Name);
|
filterNames.Add(qual[e.ToUpper()].Name);
|
||||||
} else if (e.All(char.IsAsciiDigit) && mgnr.ContainsKey(e)) {
|
} else if (e.All(char.IsAsciiDigit) && mgnr.TryGetValue(e, out var member)) {
|
||||||
filterMgNr.Add(int.Parse(e));
|
filterMgNr.Add(int.Parse(e));
|
||||||
filter.RemoveAt(i--);
|
filter.RemoveAt(i--);
|
||||||
filterNames.Add(mgnr[e].AdministrativeName);
|
filterNames.Add(member.AdministrativeName);
|
||||||
} else if (attr.ContainsKey(e.ToLower())) {
|
} else if (attr.ContainsKey(e.ToLower())) {
|
||||||
var a = attr[e.ToLower()];
|
var a = attr[e.ToLower()];
|
||||||
filterAttr.Add(a.AttrId);
|
filterAttr.Add(a.AttrId);
|
||||||
@ -377,7 +377,7 @@ namespace Elwig.Windows {
|
|||||||
filterZwst.Add(b.ZwstId);
|
filterZwst.Add(b.ZwstId);
|
||||||
filter.RemoveAt(i--);
|
filter.RemoveAt(i--);
|
||||||
filterNames.Add($"Zweigstelle {b.Name}");
|
filterNames.Add($"Zweigstelle {b.Name}");
|
||||||
} else if (e.StartsWith(">") || e.StartsWith("<")) {
|
} else if (e.StartsWith('>') || e.StartsWith('<')) {
|
||||||
if (double.TryParse(e[1..], out var num)) {
|
if (double.TryParse(e[1..], out var num)) {
|
||||||
switch ((e[0], num)) {
|
switch ((e[0], num)) {
|
||||||
case ('>', <= 30): filterKmwGt = num; break;
|
case ('>', <= 30): filterKmwGt = num; break;
|
||||||
@ -467,7 +467,7 @@ namespace Elwig.Windows {
|
|||||||
filterNames.Add($"bis zum {n2}");
|
filterNames.Add($"bis zum {n2}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (e.Length > 2 && e.StartsWith("\"") && e.EndsWith("\"")) {
|
} else if (e.Length > 2 && e.StartsWith('"') && e.EndsWith('"')) {
|
||||||
filter[i] = e[1..^1];
|
filter[i] = e[1..^1];
|
||||||
} else if (e.Length <= 2) {
|
} else if (e.Length <= 2) {
|
||||||
filter.RemoveAt(i--);
|
filter.RemoveAt(i--);
|
||||||
@ -1590,7 +1590,7 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void GradationKmwInput_LostFocus(object sender, RoutedEventArgs evt) {
|
private void GradationKmwInput_LostFocus(object sender, RoutedEventArgs evt) {
|
||||||
if (GradationKmwInput.Text.EndsWith(",")) GradationKmwInput.Text += "0";
|
if (GradationKmwInput.Text.EndsWith(',')) GradationKmwInput.Text += "0";
|
||||||
InputLostFocus((TextBox)sender, Validator.CheckGradationKmw);
|
InputLostFocus((TextBox)sender, Validator.CheckGradationKmw);
|
||||||
if (GradationKmwInput.Text.Length != 0 && !GradationKmwInput.Text.Contains(','))
|
if (GradationKmwInput.Text.Length != 0 && !GradationKmwInput.Text.Contains(','))
|
||||||
GradationKmwInput.Text += ",0";
|
GradationKmwInput.Text += ",0";
|
||||||
@ -1688,7 +1688,7 @@ namespace Elwig.Windows {
|
|||||||
if (sender is not TextBox tb) return;
|
if (sender is not TextBox tb) return;
|
||||||
if (tb.Text.Length > 0) {
|
if (tb.Text.Length > 0) {
|
||||||
if (!tb.Text.Contains(',')) tb.Text += ",0";
|
if (!tb.Text.Contains(',')) tb.Text += ",0";
|
||||||
if (tb.Text.EndsWith(",")) tb.Text += "0";
|
if (tb.Text.EndsWith(',')) tb.Text += "0";
|
||||||
}
|
}
|
||||||
InputLostFocus(tb, Validator.CheckDecimal(tb, false, 2, 1));
|
InputLostFocus(tb, Validator.CheckDecimal(tb, false, 2, 1));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user