protected void Page_Load(object sender, System.EventArgs e)
        {
            // Load Protal Definition and the current Tab
            PortalDefinition pd = PortalDefinition.Load();

            PortalDefinition.Tab currentTab = pd.GetTab(Request["TabRef"]);

            // Foreach Tab...
            ArrayList tabList    = new ArrayList();
            ArrayList subTabList = new ArrayList();

            foreach (PortalDefinition.Tab t in pd.tabs)
            {
                DisplayTabItem dt = BuildDisplayTabItem(t);
                if (dt != null)
                {
                    // Set current Tab Property
                    if (currentTab == null)
                    {
                        if (tabList.Count == 1)
                        {
                            // First tab -> default
                            dt.CurrentTab = true;
                        }
                    }
                    else
                    {
                        dt.CurrentTab = currentTab.RootTab == t;
                    }
                    tabList.Add(dt);

                    if (dt.CurrentTab && Config.TabMenuShowSubTabs)
                    {
                        foreach (PortalDefinition.Tab st in t.tabs)
                        {
                            DisplayTabItem sdt = BuildDisplayTabItem(st);
                            if (sdt != null)
                            {
                                subTabList.Add(sdt);
                            }
                        }
                    }
                }
            }             // foreach(tab)

            // Bind Repeater
            Tabs.DataSource = tabList;
            Tabs.DataBind();

            if (subTabList.Count > 0)
            {
                TabMenu_SubTab.Visible = true;
                SubTabs.DataSource     = subTabList;
                SubTabs.DataBind();
            }
            else
            {
                TabMenu_SubTab.Visible = false;
            }
        }
        public void SelectSubTab(SubTabs tab)
        {
            FrameworkBase.Log.LogMessage(string.Format("Selecting the sub tab {0} in participate page", tab.ToString()));
            int    tabIndex = new CompetitionDetailsPageOps().SelectedTabIndex;
            string query    = string.Format("//div[@id='tabParticipantContainer']/div[{0}]/nav/ul/li[{1}]", tabIndex, (int)tab);

            Operations.ClickElement(Elements.GetElementByXPath(query));
            Utils.WaitForLoaderExit("preloader");
        }
Example #3
0
        /// <summary>
        /// 根据选择的tal获取回复tab列表
        /// </summary>
        public void GetReplyToTab()
        {
            string returnMsg = string.Empty;
            int    errorCode = 0;

            // 校验参数
            string[] parametersRequired = { "projectId", "categoryId" };
            if (!CheckParamsRequired(parametersRequired, out errorCode, out returnMsg))
            {
                JsonResult <string> result = new JsonResult <string> {
                    Code = errorCode, Message = returnMsg, Rows = 0, Result = null
                };
                GenerateJson(result);
                return;
            }
            // 获取列表
            FileCategoryBLL fcBll          = new FileCategoryBLL();
            DataTable       fileCategories = fcBll.GetReplyToTab(context, out errorCode).Tables[0];

            if (fileCategories != null && fileCategories.Rows.Count > 0)
            {
                List <SubTabs> subTabs = new List <SubTabs>();
                for (int i = 0; i < fileCategories.Rows.Count; i++)
                {
                    SubTabs sub = new SubTabs();
                    sub.Id = fileCategories.Rows[i]["ID"].ToString();
                    //sub.hasParent = fileCategories.Rows[i]["hasParent"].ToString() == "1";
                    sub.categoryId = fileCategories.Rows[i]["categoryId"].ToString();
                    sub.Title      = fileCategories.Rows[i]["title"].ToString();
                    subTabs.Add(sub);
                }
                string message = ErrorCode.GetCodeMessage(errorCode);
                JsonResult <SubTabs> result = new JsonResult <SubTabs> {
                    Code = errorCode, Message = message, Rows = subTabs.Count(), Result = subTabs
                };
                GenerateJson(result);
                return;
            }
            else
            {
                string message             = ErrorCode.GetCodeMessage(errorCode);
                JsonResult <string> result = new JsonResult <string> {
                    Code = errorCode, Message = message, Rows = 0, Result = null
                };
                GenerateJson(result);
                return;
            }
        }