Code Block
#Region
"Methods"
<# foreach(Field lField in CurrentEntity.Fields) { #>
Public Overridable Function <#=
lField.Name #>
() As ValidationCheckCol Implements I<#=
CurrentEntity.CodeName #>
Validator.<#=
lField.Name #>
Dim lReturn As New ValidationCheckCol
<# if (!lField.Nullable) {#>
lReturn.Add(ValidationFactory.NullValidation("<#=
lField.DisplayName #>
", Entity, "<#=
lField.Name #>
"))
<# } #>
<# if (lField.ConstrainLength) {#>
lReturn.Add(ValidationFactory.LengthValidation("<#=
lField.DisplayName #>
", Entity, "<#=
lField.Name #>
", <#=
lField.Length #>
))
<# } #>
<# if (lField.RefData.Name.Length > 0) {#>
lReturn.Add(ValidationFactory.LookupValidation("<#=
lField.DisplayName #>
", Entity, "<#=
lField.Name #>
", <#=
lField.RefData.Name #>
, "<#=
lField.RefData.ValueProperty #>
"))
<# } #>
<# if (lField.Name == "BeginEffectiveDate" ) {#>
lReturn.Add(ValidationFactory.DateComparisonValidation("Begin Effective Date", Entity, "BeginEffectiveDate", "EndEffectiveDate", "Value of {0} is more than the End Effective Date {1}"))
<# } #>
<# if (lField.Name == "EndEffectiveDate" ) {#>
lReturn.Add(ValidationFactory.DateComparisonValidation("End Effective Date", Entity, "BeginEffectiveDate", "EndEffectiveDate", "Value of {1} is less than the Begin Effective Date {0}"))
<# } #>
<# if (lField.Type == "DateTime" ) {#>
lReturn.Add(ValidationFactory.DateRangeValidation("<#=
lField.DisplayName #>
", Entity, "<#=
lField.Name #>
"))
<# } #>
Return lReturn
End Function
<# } #>
#End
Region