Exemplo n.º 1
0
        public void PutRootSelectedTable(string tableAlias)
        {
            if (SelectedTables == null)
            {
                SelectedTables = new List <List <string> >();
            }

            for (int index = 0; index < SelectedTables.Count; index++)
            {
                List <string> path = SelectedTables[index];
                if (path == null)
                {
                    path = new List <string>();
                    path.Add(tableAlias);
                }
                else
                {
                    if (!BaseMarkupUtilities.IsExistOnList(path, tableAlias))
                    {
                        path.Insert(0, tableAlias);
                    }
                }
                SelectedTables[index] = path;
            }
        }
Exemplo n.º 2
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;
                }
            }
        }