Esempio n. 1
0
        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());
        }
Esempio n. 2
0
 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)));
     }
 }
Esempio n. 3
0
        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));
            }
        }
Esempio n. 4
0
 private string GetAlias(ColumnArrayElement item, int index)
 {
     return(String.Format("{0}_{1}", item.Alias, this.ColumnNumber(item.ColumnNames[index])));
 }
Esempio n. 5
0
 public void EndColumnArray(ColumnArrayElement array)
 {
 }