Saxonite 1.2.11.13

This commit is contained in:
Andy Howard
2024-08-22 20:02:41 +01:00
parent 2eb778ac17
commit 209dd7ca93
2 changed files with 29 additions and 21 deletions
+2 -2
View File
@@ -46,13 +46,13 @@ namespace Sarand.Net.Standard.Base.Bus
protected bool IsValidValue (String value, String attributeName, long maxLen, bool mandatory = false, bool fixedLen = false)
{
// Check for mandatory values:
if (mandatory && StringUtil.IsEmpty(value))
if (mandatory && StringUtil.IsBlank(value))
return SetErrorState(attributeName + " is blank");
// Check that value does not exceed the maximum number of characters:
if (maxLen > 0 && StringUtil.GetLength(value) > maxLen)
return SetErrorState(attributeName + " must not exceed " + maxLen.ToString() + " character" + ((maxLen > 1) ? "s" : ""));
// Check that fixed length values are the specified length:
if (fixedLen && maxLen > 0 && (mandatory || !value.IsEmpty()) && StringUtil.GetLength(value) != maxLen)
if (fixedLen && maxLen > 0 && (mandatory || !value.IsBlank()) && StringUtil.GetLength(value) != maxLen)
return SetErrorState(attributeName + " must be " + maxLen.ToString() + " character" + ((maxLen > 1) ? "s" : "") + " in length");
return true;
}