private void PrepareFields() { _fields.Clear(); var i = 0; foreach (var attr in Query.Attributes) { _fields.Add( new SqlQueryField { Index = i, SelectAttribute = attr, AttrDef = attr.Def, AttributeId = attr.Def != null ? attr.Def.Id : Guid.Empty, AttributeName = attr.Def != null ? attr.Def.Name : SystemIdentConverter.Convert(attr.Ident), IsIdent = attr.IsSystemIdent, Ident = attr.IsSystemIdent ? attr.Ident : SystemIdent.Id, IsExp = attr.IsMultiExpression, DocDef = attr.Attributes[0].Source != null ? attr.Attributes[0].Source.GetDocDef() : null, DocDefId = attr.Attributes[0].Source != null ? attr.Attributes[0].Source.GetDocDef().Id : Guid.Empty, DataType = attr.IsSystemIdent ? SystemIdentConverter.ToBaseType(attr.Ident) : attr.Def != null ? CissaDataTypeHelper.ConvertToBase(attr.Def.Type.Id) : BaseDataType.Unknown }); i++; } }
public override BaseDataType GetDataType() { if (Grouping == SqlQuerySummaryFunction.Count) { return(BaseDataType.Int); } return(AttrDef != null ? CissaDataTypeHelper.ConvertToBase(AttrDef.Type.Id) : SystemIdentConverter.ToBaseType(Ident)); }