/// <summary>
        /// 根据<see cref="P:Feng.WindowTabInfo.Name"/>得到<see cref="WindowTabInfo"/>数据
        /// </summary>
        /// <param name="windowTabId"></param>
        /// <returns></returns>
        private WindowTabInfo GetWindowTabInfoReal(string windowTabId)
        {
            return(Cache.TryGetCache <WindowTabInfo>(GetCacheKey <WindowTabInfo>(windowTabId), new Func <WindowTabInfo>(delegate()
            {
                WindowTabInfo r = null;
                ICache c = ServiceProvider.GetService <ICache>();

                IEnumerable <WindowTabInfo> listAll = GetInfos <WindowTabInfo>();
                foreach (WindowTabInfo info in listAll)
                {
                    if (info.Parent == null)
                    {
                        SearchTabChilds(info, listAll);
                    }

                    if (c != null)
                    {
                        c.Put(GetCacheKey <WindowTabInfo>(info.ID), info);
                    }

                    if (info.ID == windowTabId)
                    {
                        r = info;
                    }
                }
                return r;
            })));
        }
        private void SearchTabChilds(WindowTabInfo parent, IEnumerable <WindowTabInfo> listAll)
        {
            parent.ChildTabs = new List <WindowTabInfo>();
            foreach (WindowTabInfo menu in listAll)
            {
                if (menu.Parent != null &&
                    menu.Parent.ID == parent.ID)
                {
                    menu.Parent = parent;
                    parent.ChildTabs.Add(menu);

                    SearchTabChilds(menu, listAll);
                }
            }
        }
Exemple #3
0
        private void CreateColumns(int level, WindowTabInfo tabInfo)
        {
            string gridName = tabInfo.GridName; //"网页查询_客户委托情况_进口";
            foreach (GridColumnInfo info in ADInfoBll.Instance.GetGridColumnInfos(gridName))
            {
                if (info.GridColumnType == GridColumnType.Normal)
                {
                    if (!Authority.AuthorizeByRule(info.ColumnVisible))
                        continue;

                    if (this.Grid1.Levels.Count <= level)
                    {
                        this.Grid1.Levels.Add(new ComponentArt.Web.UI.GridLevel());
                    }

                    ComponentArt.Web.UI.GridColumn column = GetColumn(info);
                    if (!this.Grid1.Levels[level].Columns.Contains(column))
                    {
                        this.Grid1.Levels[level].Columns.Add(GetColumn(info));
                    }
                }
            }

            //m_levelTabInfos[level] = tabInfo;
            //if (tabInfo.Childs.Count > 1)
            //{
            //    //throw new NotSupportedException("only one child is supported!");
            //}

            //for (int i = 0; i < Math.Min(1, tabInfo.Childs.Count); i++)
            //{
            //    WindowTabInfo subTabInfo = tabInfo.Childs[i];
            //    CreateColumns(level + 1, subTabInfo);

            //    if (!m_isHierarchicalEventCreated)
            //    {
            //        this.Grid1.NeedChildDataSource += new ComponentArt.Web.UI.Grid.NeedChildDataSourceEventHandler(Grid1_NeedChildDataSource);
            //        m_isHierarchicalEventCreated = true;
            //    }
            //}

            for (int i = 0; i <tabInfo.ChildTabs.Count; i++)
            {
                this.Grid1.Levels[level].Columns[i].DataCellCssClass = "DetailTemplate";
            }
        }