Closed JasonLounsbery closed 8 years ago
The function that determines if it is required or not.
Fieldattributes is a list of properites that are required
[DataMember]
public List
IsRequired is returning the correct value, but the property,'ADDRESS', is still being flagged as required
public bool isRequired(string value,string FieldName)
{
bool return_bool = false;
string v = value;
if (FieldAttributes == null)
return false;
var hasitems = from Fields in FieldAttributes
where Fields.AttributeTypeCode == FieldName
select Fields;
foreach(UserAttributeType u in hasitems)
{
if(u.IsActive)
return u.Required;
}
return return_bool;
}
can something like this be done?
I have a property that determines if a field is required. It always says it is required
[DataMember] [Description("Address Line 1")] [RequiredIf("isRequired(ADDRESS,'STREET') == true", ErrorMessage="Address is Required")] public string ADDRESS { get; set; }