MemberAdminWindow: Fix error when saving telephone numbers
All checks were successful
Test / Run tests (push) Successful in 2m23s

This commit is contained in:
2024-08-01 15:57:49 +02:00
parent 8db6007264
commit 4403754ada
2 changed files with 2 additions and 2 deletions

View File

@ -549,7 +549,7 @@ namespace Elwig.Services {
ctx.RemoveRange(ctx.MemberTelephoneNrs.Where(t => t.MgNr == oldMgNr)); ctx.RemoveRange(ctx.MemberTelephoneNrs.Where(t => t.MgNr == oldMgNr));
ctx.AddRange(vm.PhoneNrs ctx.AddRange(vm.PhoneNrs
.Where(input => input.Number != null) .Where(input => input.Number != null && input.Number != "")
.Select((input, i) => new MemberTelNr { .Select((input, i) => new MemberTelNr {
MgNr = m.MgNr, MgNr = m.MgNr,
Nr = i + 1, Nr = i + 1,

View File

@ -402,7 +402,7 @@ namespace Elwig.Windows {
protected bool InputLostFocus(TextBox input, ValidationResult res, string? msg = null) { protected bool InputLostFocus(TextBox input, ValidationResult res, string? msg = null) {
if (DoShowWarningWindows && !res.IsValid && !IsClosing && (IsEditing || IsCreating)) if (DoShowWarningWindows && !res.IsValid && !IsClosing && (IsEditing || IsCreating))
MessageBox.Show(res.ErrorContent.ToString(), msg ?? res.ErrorContent.ToString(), MessageBoxButton.OK, MessageBoxImage.Warning); MessageBox.Show(res.ErrorContent?.ToString(), msg ?? res.ErrorContent?.ToString(), MessageBoxButton.OK, MessageBoxImage.Warning);
return res.IsValid; return res.IsValid;
} }