Beispiel #1
0
 /// <summary>
 /// Selects from tables.
 /// </summary>
 /// <param name="tables">The tables.</param>
 public void SelectFromTables(params string[] tables)
 {
     SelectedTables.Clear();
     foreach (var table in tables)
     {
         SelectedTables.Add(table);
     }
 }
Beispiel #2
0
 /// <inheritdoc />
 public ISelectStringBuilder From(params string[] tableNames)
 {
     SelectedTables.Clear();
     foreach (var table in tableNames)
     {
         SelectedTables.Add(table);
     }
     return(this);
 }
Beispiel #3
0
        public void PutSelectedTable(string tableAlias, bool createNewPath)
        {
            if (SelectedTables == null)
            {
                SelectedTables = new List <List <string> >();
            }

            if (SelectedTables.Count == 0)
            {
                List <string> path = new List <string>();
                if (!string.IsNullOrWhiteSpace(tableAlias))
                {
                    path.Add(tableAlias);
                }
                SelectedTables.Add(path);
            }
            else
            {
                if (createNewPath)
                {
                    List <string> path = new List <string>();
                    if (!string.IsNullOrWhiteSpace(tableAlias))
                    {
                        path.Add(tableAlias);
                    }
                    SelectedTables.Add(path);
                }
                else
                {
                    int           index = SelectedTables.Count - 1;
                    List <string> path  = SelectedTables[index];
                    if (path == null)
                    {
                        path = new List <string>();
                        if (!string.IsNullOrWhiteSpace(tableAlias))
                        {
                            path.Add(tableAlias);
                        }
                    }
                    else
                    {
                        if (!string.IsNullOrWhiteSpace(tableAlias) && !BaseMarkupUtilities.IsExistOnList(path, tableAlias))
                        {
                            // path.Insert(0, tableAlias);
                            path.Add(tableAlias);
                        }
                    }
                    SelectedTables[index] = path;
                }
            }
        }
Beispiel #4
0
 /// <summary>
 /// Selects from table.
 /// </summary>
 /// <param name="table">The table.</param>
 public void SelectFromTable(string table)
 {
     SelectedTables.Clear();
     SelectedTables.Add(table);
 }