DeliveryAdminWindow: Fix ModifierInput_SelectionChanged event
This commit is contained in:
@ -1154,12 +1154,12 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async Task UpdateLsNr() {
|
private async Task UpdateLsNr() {
|
||||||
if (ViewModel.Date == "" || ViewModel.Branch == null) {
|
if (string.IsNullOrEmpty(ViewModel.Date) || ViewModel.Branch == null) {
|
||||||
ViewModel.LsNr = "";
|
ViewModel.LsNr = "";
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
var branch = (Branch)BranchInput.SelectedItem;
|
var branch = (Branch)BranchInput.SelectedItem;
|
||||||
var date = DateOnly.ParseExact(ViewModel.Date, "dd.MM.yyyy");
|
var date = DateOnly.ParseExact(ViewModel.Date!, "dd.MM.yyyy");
|
||||||
using var ctx = new AppDbContext();
|
using var ctx = new AppDbContext();
|
||||||
var lnr = await ctx.NextLNr(date);
|
var lnr = await ctx.NextLNr(date);
|
||||||
ViewModel.LsNr = Utils.GenerateLsNr(date, branch.ZwstId, lnr);
|
ViewModel.LsNr = Utils.GenerateLsNr(date, branch.ZwstId, lnr);
|
||||||
@ -1287,7 +1287,10 @@ namespace Elwig.Windows {
|
|||||||
if (App.Client.IsMatzen) {
|
if (App.Client.IsMatzen) {
|
||||||
var kl = mod.Where(m => m.Name.StartsWith("Klasse "));
|
var kl = mod.Where(m => m.Name.StartsWith("Klasse "));
|
||||||
if (kl.Count() > 1) {
|
if (kl.Count() > 1) {
|
||||||
foreach (var r in kl.Take(kl.Count() - 1)) ModifiersInput.SelectedItems.Remove(r);
|
App.MainDispatcher.BeginInvoke(() => {
|
||||||
|
foreach (var r in kl.Take(kl.Count() - 1))
|
||||||
|
ModifiersInput.SelectedItems.Remove(r);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user