Implement Betriebsnummer check

This commit is contained in:
2023-04-16 21:42:40 +02:00
parent aadbd2b724
commit 569d7f2cc4

View File

@ -246,9 +246,16 @@ namespace Elwig.Helpers {
return new(false, "Betriebsnummer zu kurz");
}
// TODO
// https://statistik.at/fileadmin/shared/QM/Standarddokumentationen/RW/std_r_land-forstw_register.pdf#page=41
int s = 0;
for (int i = 0; i < 6; i++)
s += (input.Text[i] - '0') * (7 - i);
s = (11 - (s % 11)) % 10;
return new(true, "Not implemented yet");
if (s != (input.Text[6] - '0'))
return new(false, "Prüfsumme der Betriebsnummer ist falsch");
return new(true, null);
}
public static ValidationResult CheckUstId(TextBox input, bool required) {