Update models because contracts were removed

This commit is contained in:
2023-05-01 22:17:50 +02:00
parent 54aaf9fda0
commit c8f0537976
9 changed files with 77 additions and 103 deletions

View File

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