Saxonite 1.2.11.13
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user