예제 #1
0
        protected string GetXslPath(BaseBookmark xmlBm, string bizName, bool isIf, List <string> selectedTables,
                                    Relations relations, XmlNode startNode = null)
        {
            BookmarkType type = xmlBm == null ? BookmarkType.Select : xmlBm.Type;

            switch (type)
            {
            case BookmarkType.PdeTag:
            case BookmarkType.PdeChart:
                return(GetPdeXslPath(bizName, selectedTables));

            case BookmarkType.StartForeach:
                if (_foreach[_foreach.Count - 1].IsContainPdeTag)
                {
                    return(GetPdeXslPath(bizName, selectedTables));
                }
                else
                {
                    return(GetPdwXslPath(bizName, isIf, selectedTables, relations, startNode));
                }

            default:
                return(GetPdwXslPath(bizName, isIf, selectedTables, relations, startNode));
            }
        }
예제 #2
0
            private List <string> FindTableNames(int index, IEnumerable <BaseBookmark> bookmarks, Pdw.Core.Relations relation)
            {
                int           boltForeach = 1;
                List <string> tableNames  = new List <string>();

                for (int i = index + 1; i < bookmarks.Count(); i++)
                {
                    BaseBookmark item = bookmarks.ElementAt(i);

                    // to setup commanding position on stop lookup children
                    if (boltForeach < 1)
                    {
                        break;
                    }

                    switch (item.Type)
                    {
                    case Core.BookmarkType.Select:
                    case Core.BookmarkType.StartIf:
                        if (boltForeach == 1)
                        {
                            tableNames.Add(GetTableName(item, relation));
                        }
                        break;

                    case BookmarkType.PdeTag:
                        if (boltForeach == 1)
                        {
                            tableNames.Add(item.Key);
                        }
                        _selectedTable = new List <List <string> >();
                        _selectedTable.Add(tableNames);
                        IsContainPdeTag = true;
                        break;

                    case Core.BookmarkType.StartForeach:
                        boltForeach++;
                        break;

                    case Core.BookmarkType.EndForeach:
                        boltForeach--;
                        break;

                    default:
                        break;
                    }
                }

                return(tableNames);
            }
예제 #3
0
            private string GetTableName(BaseBookmark item, Pdw.Core.Relations relation)
            {
                // find biz name
                string bizName = item.BizName;

                // find table name
                string tableName = string.Empty;

                if (relation.MapInfos.ContainsKey(bizName))
                {
                    tableName = relation.MapInfos[bizName].TableName;
                }

                return(tableName);
            }
예제 #4
0
        protected List <string> GetSelectedTables(BaseBookmark pbmItem)
        {
            if (pbmItem != null)
            {
                switch (pbmItem.Type)
                {
                case BookmarkType.PdeTag:
                case BookmarkType.PdeChart:
                    return(GetPdeSelectedTables(pbmItem.Key));

                default:
                    return(GetPdwSelectedTables(pbmItem));
                }
            }

            return(new List <string>());
        }
예제 #5
0
        private List <string> GetPdwSelectedTables(BaseBookmark pbmItem)
        {
            string ibmItemKey = pbmItem.Key;
            InternalBookmarkDomain ibmDomain = _ibm.GetInternalBookmarkDomainByItemKey(ibmItemKey);
            string bizName = pbmItem.BizName;

            if (string.IsNullOrWhiteSpace(bizName))
            {
                InternalBookmarkItem ibmItem = ibmDomain.InternalBookmarkItems.FirstOrDefault(c => c.Key == ibmItemKey);
                bizName = ibmItem.OrginalBizName;
            }
            Relations relations = GetRelations(pbmItem);

            if (relations != null && relations.MapInfos.ContainsKey(bizName))
            {
                string tableName = relations.MapInfos[bizName].TableName;
                return(ibmDomain.GetSelectedTabledOfPath(tableName));
            }
            return(ibmDomain.GetAllSelectedTables());
        }
예제 #6
0
        protected Relations GetRelations(BaseBookmark pbmItem)
        {
            if (pbmItem != null)
            {
                switch (pbmItem.Type)
                {
                case BookmarkType.PdeTag:
                    return(new Relations());

                case BookmarkType.PdeChart:
                    return(new Relations());

                default:
                    string ibmItemKey = pbmItem.Key;
                    InternalBookmarkDomain ibmDomain = _ibm.GetInternalBookmarkDomainByItemKey(ibmItemKey);
                    return(ibmDomain.Relations);
                }
            }

            return(new Relations());
        }