1 using System.ComponentModel.DataAnnotations;
3 namespace sage.ew.contabilidad.Validations
5 internal class ReferenciaCatastralRequiredAttribute : RequiredAttribute
7 protected override ValidationResult IsValid(
object value, ValidationContext validationContext)
10 string lcReferencia =
string.Empty;
11 if (!
string.IsNullOrEmpty(value.ToString()))
13 if (value.ToString().Trim().Length < 20)
14 return new ValidationResult(
"La referencia catastral debe tener como mÃnimo 20 caracteres.",
new string[] { validationContext.MemberName });
22 return new ValidationResult(
"Es necesario indicar la referencia catastral del inmueble.",
new string[] { validationContext.MemberName });
27 return new ValidationResult(
"Es necesario indicar la referencia catastral del inmueble.",
new string[] { validationContext.MemberName });
31 return ValidationResult.Success;
Clase Referencias catastrales
int _Territorio
Territorio