public ModelMessage AddFormMessage(BizForm form, Guid attrId, string message) { if (form != null) { var finder = new ControlFinder(form); var ctrl = finder.FirstOrDefault( c => c is BizDataControl && ((BizDataControl)c).AttributeDefId == attrId); if (ctrl != null) { return(AddMessage(ctrl.Id, message)); } } return(AddMessage(attrId, message)); }
public ModelMessage AddFormMessage(BizForm form, string name, string message) { if (form != null) { var finder = new ControlFinder(form); var ctrl = finder.FirstOrDefault( c => c is BizDataControl && String.Equals(((BizDataControl)c).AttributeName, name, StringComparison.InvariantCultureIgnoreCase)); if (ctrl != null) { return(AddMessage(ctrl.Id, name, message)); } } return(AddMessage(name, message)); }