Move more input checker methods to AdminWindow

This commit is contained in:
2023-04-16 20:28:14 +02:00
parent 2c2ac46b2e
commit aadbd2b724
7 changed files with 115 additions and 111 deletions

@ -30,7 +30,7 @@ namespace Elwig.Helpers {
{ "423", Array.Empty<string[]>() },
};
public static ValidationResult CheckNumeric(TextBox input, bool required) {
public static ValidationResult CheckInteger(TextBox input, bool required) {
return CheckNumeric(input, required, -1);
}
@ -257,7 +257,7 @@ namespace Elwig.Helpers {
}
public static ValidationResult CheckMgNr(TextBox input, bool required, AppDbContext ctx, Member? m) {
var res = CheckNumeric(input, required);
var res = CheckInteger(input, required);
if (!res.IsValid) {
return res;
} else if (!required && input.Text.Length == 0) {
@ -273,7 +273,7 @@ namespace Elwig.Helpers {
}
public static ValidationResult CheckPredecessorMgNr(TextBox input, bool required, AppDbContext ctx) {
var res = CheckNumeric(input, required);
var res = CheckInteger(input, required);
if (!res.IsValid) {
return res;
} else if (!required && input.Text.Length == 0) {
@ -296,7 +296,7 @@ namespace Elwig.Helpers {
}
public static ValidationResult CheckVNr(TextBox input, bool required, AppDbContext ctx, Contract? c) {
var res = CheckNumeric(input, required);
var res = CheckInteger(input, required);
if (!res.IsValid) {
return res;
} else if (!required && input.Text.Length == 0) {