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

This commit is contained in:
lorenz.stechauner committed 2024-03-10 21:31:59 +01:00
1 parent acc159ed9c
commit f3cdac8a61
3 files changed
+113 -85

No files matched your search

+2 -1
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");