private static void SetSelectItemInfoFromField(DslFormatItem formatItem, DataSourceFieldInfo field) { if (string.IsNullOrEmpty(formatItem.DisplayName)) { formatItem.DisplayName = field.Name; } if (string.IsNullOrEmpty(formatItem.Description)) { formatItem.Description = field.Description; } }
private void ProcessSelectItem(DataSourceInfo dataSource, long userId, DslFormatItem selectItem, string selectItemProperty) { if (string.IsNullOrEmpty(selectItem.Name)) { selectItem.Name = selectItemProperty; } var isValueField = _queryVariableNameBuilder.IsSimpleValue(selectItemProperty); if (!isValueField) { if (string.IsNullOrEmpty(selectItem.Name)) { throw new SelectFieldNameEmptyException(selectItem.Value); } } DataSourceFieldInfo inheritedField; var isCanRequestColumn = _formatBlockValueAccessEvaluator.IsAccessible( selectItemProperty, dataSource.Key, userId, out inheritedField); if (!isCanRequestColumn) { selectItem.Value = QueryKey.QueryEmptyString; return; } if (inheritedField == null) { return; } SetSelectItemInfoFromField(selectItem, inheritedField); }