[#43] AreaComAdminWindow: Do not use Context from ContextWindow any more

This commit is contained in:
2024-03-10 21:31:59 +01:00
parent acc159ed9c
commit f3cdac8a61
3 changed files with 113 additions and 85 deletions

View File

@ -576,7 +576,7 @@ namespace Elwig.Helpers {
}
}
public static ValidationResult CheckFbNr(TextBox input, bool required, AppDbContext ctx, AreaCom? c) {
public static ValidationResult CheckFbNr(TextBox input, bool required, AreaCom? c) {
var res = CheckInteger(input, required);
if (!res.IsValid) {
return res;
@ -584,6 +584,7 @@ namespace Elwig.Helpers {
return new(true, null);
}
using var ctx = new AppDbContext();
int nr = int.Parse(input.Text);
if (nr != c?.FbNr && ctx.FbNrExists(nr).GetAwaiter().GetResult()) {
return new(false, "Flächenbindungsnummer wird bereits verwendet");