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); }
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); }
protected override SqlQuerySourceAttribute AddAttribute(string attrDefName) { var subAttribute = SubQuery.GetAttribute(attrDefName); var alias = GetAttributeAlias(String.IsNullOrEmpty(subAttribute.Alias) ? subAttribute.AliasName : subAttribute.Alias); //subAttribute.AliasName); if (!String.IsNullOrEmpty(AliasName)) { alias = AliasName + "_" + alias; } AttributeAliases.Add(alias.ToUpper()); var attribute = new SqlQuerySubSourceAttribute(subAttribute, alias); Attributes.Add(attribute); return(attribute); }
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); }
/// <summary> /// Sets an alias for an attribute. /// </summary> /// <param name="name">the iText tagname</param> /// <param name="alias">the custom tagname</param> public override void AddAlias(string name, string alias) { AttributeAliases.Add(alias.ToLower(CultureInfo.InvariantCulture), name); }
/// <summary> /// Sets an alias for an attribute. /// </summary> /// <param name="name">the iText tagname</param> /// <param name="alias">the custom tagname</param> public override void AddAlias(string name, string alias) => AttributeAliases.Add(alias.ToLowerInvariant(), name);