Class DataTypeIntegrity
- Namespace
- CMS.FormEngine
- Assembly
- CMS.FormEngine.dll
Provides check if given value matches field's data type.
public class DataTypeIntegrity
- Inheritance
-
objectDataTypeIntegrity
- Extension Methods
Constructors
DataTypeIntegrity(object, FormFieldInfo, CultureInfo)
Constructor.
public DataTypeIntegrity(object value, FormFieldInfo ffi, CultureInfo culture = null)
Parameters
value
objectControl's value
ffi
FormFieldInfoField info
culture
CultureInfoAllows to specify culture that will be used for culture dependent data types, e.g. double, date-time. Current culture is used if not set.
DataTypeIntegrity(object, string, CultureInfo)
Constructor.
public DataTypeIntegrity(object value, string dataType, CultureInfo culture = null)
Parameters
value
objectControl's value
dataType
stringField data type
culture
CultureInfoAllows to specify culture that will be used for culture dependent data types, e.g. double, date-time. Current culture is used if not set.
Properties
DecimalPrecision
Defines the maximum number of digits which are allowed for decimal value.
public int DecimalPrecision { get; set; }
Property Value
- int
Remarks
The precision must be a value from 1 through the maximum precision of 38.
DecimalScale
Defines the maximum number of decimal places which are allowed for decimal value.
public int DecimalScale { get; set; }
Property Value
- int
Remarks
Scale must be a value from 0 through DecimalPrecision. Scale can be specified only if DecimalPrecision is specified.
TextLength
Defines maximal length of string value.
public int TextLength { get; set; }
Property Value
- int
Methods
GetValidationResult()
Checks if value matches field's data type.
public DataTypeIntegrityValidationResult GetValidationResult()
Returns
- DataTypeIntegrityValidationResult
DataTypeIntegrityValidationResult object with error message set.