public override void Validate(SAObject obj, object property) { object otherProperty = obj.GetType().GetProperty(_propertyName).GetValue(obj, null); if(property == null) { obj.Invalidate(ErrorMessage); } else if(property.ToString() != otherProperty.ToString()) { obj.Invalidate(ErrorMessage); } }
public override void Validate(SAObject obj, object property) { object otherProperty = obj.GetType().GetProperty(_propertyName).GetValue(obj, null); if(property == null) { obj.Invalidate(ErrorMessage); } else if(Convert.ToDouble(property) >= Convert.ToDouble(otherProperty)) { obj.Invalidate(ErrorMessage); } }