private string GetFullNameWithAlias(ColumnArrayElement item, int index, string function) { StringBuilder sb = new StringBuilder(); if (function != null) { sb.Append(function); sb.Append("("); } sb.AppendFormat("{0}.[{1}]", GetFullNameOrAlias(item.Table), item.ColumnNames[index]); if (function != null) { sb.Append(")"); } if (!String.IsNullOrEmpty(item.Alias)) { sb.AppendFormat(" AS [{0}]", this.GetAlias(item, index)); } return(sb.ToString()); }
private string GetFullNameOrAlias(ColumnArrayElement item, int index) { if (String.IsNullOrEmpty(item.Alias)) { return(String.Format("{0}.[{1}]", GetFullNameOrAlias(item.Table), item.ColumnNames[index])); } else { return(String.Format("[{0}]", this.GetAlias(item, index))); } }
public void BeginColumnArray(ColumnArrayElement array) { // Determine grouping function: string function = GetFunction(array.Grouping); TableElement table = CurrentTable; for (int i = 0; i < array.ColumnCount; i++) { if (select.Length > 0) { select.Append(",\r\n "); } select.Append(GetFullNameWithAlias(array, i, function)); } }
private string GetAlias(ColumnArrayElement item, int index) { return(String.Format("{0}_{1}", item.Alias, this.ColumnNumber(item.ColumnNames[index]))); }
public void EndColumnArray(ColumnArrayElement array) { }