Esempio n. 1
0
        protected override SqlQuerySourceAttribute AddAttribute(string attrDefName)
        {
            string alias;
            SqlQuerySourceAttribute attribute;

            if (attrDefName.Length > 0 && attrDefName[0] == '&')
            {
                var ident = SystemIdentConverter.Convert(attrDefName);
                alias     = GetAttributeAlias(attrDefName);
                attribute = new SqlQueryDocSourceAttribute(ident, alias);
            }
            else
            {
                var attrDef = FindAttributeDef(attrDefName);
                if (attrDef == null)
                {
                    throw new ApplicationException(String.Format("Атрибут \"{0}\" не найден!", attrDefName));
                }
                alias     = GetAttributeAlias(attrDefName);
                attribute = new SqlQueryDocSourceAttribute(attrDef, alias);
            }
            AttributeAliases.Add(alias.ToUpper());

            Attributes.Add(attribute);

            return(attribute);
        }
Esempio n. 2
0
        protected override SqlQuerySourceAttribute AddAttribute(SystemIdent attrIdent)
        {
            var alias = GetAttributeAlias(SystemIdentConverter.Convert(attrIdent));
            SqlQuerySourceAttribute attribute = new SqlQueryDocSourceAttribute(attrIdent, alias);

            AttributeAliases.Add(alias.ToUpper());

            Attributes.Add(attribute);

            return(attribute);
        }
Esempio n. 3
0
        protected override SqlQuerySourceAttribute AddAttribute(Guid attrDefId)
        {
            var attrDef = FindAttributeDef(attrDefId);

            if (attrDef == null)
            {
                throw new ApplicationException(String.Format("Атрибут \"{0}\" не найден!", attrDefId));
            }

            var alias = GetAttributeAlias(attrDef.Name);

            AttributeAliases.Add(alias.ToUpper());
            var attribute = new SqlQueryDocSourceAttribute(attrDef, alias);

            Attributes.Add(attribute);

            return(attribute);
        }