MemberAdminWindow: Fix error when saving telephone numbers
All checks were successful
Test / Run tests (push) Successful in 2m23s
All checks were successful
Test / Run tests (push) Successful in 2m23s
This commit is contained in:
@ -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,
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user