예제 #1
0
        private void BindKnowledgeTree()
        {
            KnowledgeBLL knowledgeBLL = new KnowledgeBLL();

            IList <RailExam.Model.Knowledge> knowledgeList = knowledgeBLL.GetKnowledges();

            Pub.BuildComponentArtTreeView(tvKnowledge, (IList)knowledgeList, "KnowledgeId",
                                          "ParentId", "KnowledgeName", "KnowledgeName", "IdPath", null, null, null);
        }
예제 #2
0
        private void BindKnowledgeTree()
        {
            KnowledgeBLL knowledgeBLL = new KnowledgeBLL();
            IList <RailExam.Model.Knowledge> knowledgeList = knowledgeBLL.GetKnowledges(0, 0, "", 0, 0,
                                                                                        "", "", "", 0, 40,
                                                                                        "LevelNum,KnowledgeId ASC");

            if (knowledgeList.Count > 0)
            {
                TreeViewNode tvn     = null;
                string       strflag = Request.QueryString.Get("flag");

                foreach (RailExam.Model.Knowledge knowledge in knowledgeList)
                {
                    tvn         = new TreeViewNode();
                    tvn.ID      = knowledge.KnowledgeId.ToString();
                    tvn.Value   = knowledge.IdPath;
                    tvn.Text    = knowledge.KnowledgeName;
                    tvn.ToolTip = knowledge.KnowledgeName;
                    tvn.Attributes.Add("isKnowledge", "true");
                    tvn.ImageUrl = "~/App_Themes/" + StyleSheetTheme + "/Images/TreeView/Knowledge.gif";

                    if (strflag != null && strflag == "1")
                    {
                        tvn.ContentCallbackUrl = "~/Common/GetKnowledgeBook.aspx?itemTypeID=" + ViewState["ItemType"].ToString() + "&flag=1&id=" + knowledge.IdPath;
                    }
                    else
                    {
                        tvn.ContentCallbackUrl = "~/Common/GetKnowledgeBook.aspx?itemTypeID=" + ViewState["ItemType"].ToString() + "&id=" + knowledge.IdPath;
                    }

                    if (knowledge.ParentId == 0)
                    {
                        tvBookChapter.Nodes.Add(tvn);
                    }
                    else
                    {
                        try
                        {
                            tvBookChapter.FindNodeById(knowledge.ParentId.ToString()).Nodes.Add(tvn);
                        }
                        catch
                        {
                            tvBookChapter.Nodes.Clear();
                            SessionSet.PageMessage = "数据错误!";
                            return;
                        }
                    }
                }
            }
            //tvBookChapter.DataBind();
            //tvBookChapter.ExpandAll();
        }
예제 #3
0
        private void BindKnowledgeTree()
        {
            #region Bind knowledge tree

            KnowledgeBLL knowledgeBLL = new KnowledgeBLL();

            IList <RailExam.Model.Knowledge> knowledgeList = knowledgeBLL.GetKnowledges();

            if (knowledgeList.Count > 0)
            {
                TreeViewNode tvn = null;

                foreach (RailExam.Model.Knowledge knowledge in knowledgeList)
                {
                    tvn         = new TreeViewNode();
                    tvn.ID      = knowledge.KnowledgeId.ToString();
                    tvn.Value   = knowledge.IdPath;
                    tvn.Text    = knowledge.KnowledgeName;
                    tvn.ToolTip = knowledge.KnowledgeName;
                    tvn.Attributes.Add("isKnowledge", "true");
                    tvn.ImageUrl           = "~/App_Themes/" + StyleSheetTheme + "/Images/TreeView/Knowledge.gif";
                    tvn.ContentCallbackUrl = "../Common/GetKnowledgeBook.aspx?id=" + knowledge.IdPath;

                    if (knowledge.ParentId == 0)
                    {
                        tvView.Nodes.Add(tvn);
                    }
                    else
                    {
                        try
                        {
                            tvView.FindNodeById(knowledge.ParentId.ToString()).Nodes.Add(tvn);
                        }
                        catch
                        {
                            tvView.Nodes.Clear();
                            SessionSet.PageMessage = "Êý¾Ý´íÎó£¡";

                            return;
                        }
                    }
                }
            }

            tvView.SelectedNode = tvView.Nodes[0];

            if (tvView.Nodes.Count > 0)
            {
                tvView.Nodes[0].Expanded = true;
            }

            #endregion
        }
예제 #4
0
        private void BindKnowledgeTree()
        {
            KnowledgeBLL knowledgeBLL = new KnowledgeBLL();
            IList <RailExam.Model.Knowledge> knowledgeList = knowledgeBLL.GetKnowledges(0, 0, "", 0, 0,
                                                                                        "", "", "", 0, 40,
                                                                                        "LevelNum,KnowledgeId ASC");

            if (knowledgeList.Count > 0)
            {
                TreeViewNode tvn = null;

                foreach (RailExam.Model.Knowledge knowledge in knowledgeList)
                {
                    tvn         = new TreeViewNode();
                    tvn.ID      = knowledge.KnowledgeId.ToString();
                    tvn.Value   = knowledge.IdPath;
                    tvn.Text    = knowledge.KnowledgeName;
                    tvn.ToolTip = knowledge.KnowledgeName;
                    tvn.Attributes.Add("isKnowledge", "true");
                    tvn.ImageUrl = "~/App_Themes/" + StyleSheetTheme + "/Images/TreeView/Knowledge.gif";

                    if (knowledge.ParentId == 0)
                    {
                        tvBookChapter.Nodes.Add(tvn);
                    }
                    else
                    {
                        try
                        {
                            tvBookChapter.FindNodeById(knowledge.ParentId.ToString()).Nodes.Add(tvn);
                        }
                        catch
                        {
                            tvBookChapter.Nodes.Clear();
                            SessionSet.PageMessage = "Êý¾Ý´íÎó£¡";
                            return;
                        }
                    }
                }
            }

            Bind(tvBookChapter.Nodes);

            tvBookChapter.DataBind();
            //tvBookChapter.ExpandAll();
        }
예제 #5
0
        private void BindTree()
        {
            KnowledgeBLL knowledgeBLL = new KnowledgeBLL();

            IList <RailExam.Model.Knowledge> knowledgeList = new List <RailExam.Model.Knowledge>();

            if (!string.IsNullOrEmpty(Request.QueryString.Get("type")))
            {
                knowledgeList = knowledgeBLL.GetKnowledgesByWhereClause("id_path || '/' like '/790/%'", "LEVEL_NUM, ORDER_INDEX ASC");

                TreeViewNode tvn = null;

                foreach (RailExam.Model.Knowledge obj in knowledgeList)
                {
                    tvn         = new TreeViewNode();
                    tvn.ID      = obj.KnowledgeId.ToString();
                    tvn.Value   = obj.KnowledgeId.ToString();
                    tvn.Text    = obj.KnowledgeName;
                    tvn.ToolTip = obj.KnowledgeName;

                    if (obj.ParentId == 0)
                    {
                        tvKnowledge.Nodes.Add(tvn);
                    }
                    else
                    {
                        try
                        {
                            tvKnowledge.FindNodeById(obj.ParentId.ToString()).Nodes.Add(tvn);
                        }
                        catch
                        {
                            tvKnowledge.Nodes.Clear();
                            SessionSet.PageMessage = "数据错误!";
                            return;
                        }
                    }
                }
            }
            else
            {
                knowledgeList = knowledgeBLL.GetKnowledges();
                Pub.BuildComponentArtTreeView(tvKnowledge, (IList)knowledgeList, "KnowledgeId", "ParentId", "KnowledgeName", "KnowledgeName", "KnowledgeId", null, null, null);
            }
            //tvKnowledge.ExpandAll();
        }
예제 #6
0
        private void BindTree()
        {
            KnowledgeBLL knowledgeBLL = new KnowledgeBLL();

            IList <RailExam.Model.Knowledge> knowledgeList = knowledgeBLL.GetKnowledges();

            if (knowledgeList.Count > 0)
            {
                TreeViewNode tvn = null;

                foreach (RailExam.Model.Knowledge knowledge in knowledgeList)
                {
                    if (knowledge.LevelNum == 1)
                    {
                        tvn         = new TreeViewNode();
                        tvn.ID      = knowledge.KnowledgeId.ToString();
                        tvn.Value   = knowledge.IdPath.ToString();
                        tvn.Text    = knowledge.KnowledgeName;
                        tvn.ToolTip = knowledge.KnowledgeName;

                        if (knowledge.ParentId == 0)
                        {
                            TreeView1.Nodes.Add(tvn);
                        }
                    }
                    //else
                    //{
                    //    try
                    //    {
                    //        TreeView1.FindNodeById(knowledge.ParentId.ToString()).Nodes.Add(tvn);
                    //    }
                    //    catch
                    //    {
                    //        TreeView1.Nodes.Clear();
                    //        SessionSet.PageMessage = "数据错误!";
                    //        return;
                    //    }
                    //}
                }
            }

            TreeView1.DataBind();
            //TreeView1.ExpandAll();
        }
        private void BindKnowledgeTree()
        {
            KnowledgeBLL knowledgeBLL = new KnowledgeBLL();

            IList <RailExam.Model.Knowledge> knowledgeList = knowledgeBLL.GetKnowledges();

            if (knowledgeList.Count > 0)
            {
                TreeViewNode tvn = null;

                foreach (RailExam.Model.Knowledge knowledge in knowledgeList)
                {
                    tvn         = new TreeViewNode();
                    tvn.ID      = knowledge.KnowledgeId.ToString();
                    tvn.Value   = knowledge.KnowledgeId.ToString();
                    tvn.Text    = knowledge.KnowledgeName;
                    tvn.ToolTip = knowledge.KnowledgeName;
                    tvn.Attributes.Add("isKnowledge", "true");
                    tvn.ImageUrl           = "~/App_Themes/" + StyleSheetTheme + "/Images/TreeView/Knowledge.gif";
                    tvn.ContentCallbackUrl = "~/Common/GetKnowledgeBook.aspx?flag=1&id=" + knowledge.IdPath + "&StrategyID=" + Request.QueryString.Get("StrategyID");

                    if (knowledge.ParentId == 0)
                    {
                        tvKnowledge.Nodes.Add(tvn);
                    }
                    else
                    {
                        try
                        {
                            tvKnowledge.FindNodeById(knowledge.ParentId.ToString()).Nodes.Add(tvn);
                        }
                        catch
                        {
                            tvKnowledge.Nodes.Clear();
                            SessionSet.PageMessage = "数据错误!";
                            return;
                        }
                    }
                }
            }
            //tvKnowledge.DataBind();
            //tvKnowledge.ExpandAll();
        }
예제 #8
0
        private void BindKnowledgeTree()
        {
            #region Bind knowledge tree

            KnowledgeBLL knowledgeBLL = new KnowledgeBLL();

            IList <RailExam.Model.Knowledge> knowledgeList = knowledgeBLL.GetKnowledges();

            if (knowledgeList.Count > 0)
            {
                TreeViewNode tvn = null;

                BookBLL bookBLL = new BookBLL();
                foreach (RailExam.Model.Knowledge knowledge in knowledgeList)
                {
                    tvn         = new TreeViewNode();
                    tvn.ID      = "knowledge" + knowledge.KnowledgeId.ToString();
                    tvn.Value   = knowledge.IdPath;
                    tvn.Text    = knowledge.KnowledgeName;
                    tvn.ToolTip = knowledge.KnowledgeName;
                    tvn.Attributes.Add("isKnowledge", "true");
                    tvn.ImageUrl = "~/App_Themes/" + StyleSheetTheme + "/Images/TreeView/Knowledge.gif";
                    //tvn.ContentCallbackUrl = "/RailExamBao/Common/GetKnowledgeBook.aspx?item=no&id=" + knowledge.IdPath;

                    if (knowledge.ParentId == 0)
                    {
                        tvView.Nodes.Add(tvn);
                    }
                    else
                    {
                        try
                        {
                            tvView.FindNodeById("knowledge" + knowledge.ParentId.ToString()).Nodes.Add(tvn);
                            IList <RailExam.Model.Knowledge> objList = knowledgeBLL.GetKnowledgesByParentID(knowledge.KnowledgeId);

                            if (objList.Count == 0)
                            {
                                IList <RailExam.Model.Book> bookList = bookBLL.GetBookByKnowledgeIDPath(knowledge.IdPath);
                                if (bookList.Count > 0)
                                {
                                    foreach (RailExam.Model.Book book in bookList)
                                    {
                                        tvn         = new TreeViewNode();
                                        tvn.ID      = "book" + book.bookId.ToString();
                                        tvn.Value   = book.bookId.ToString();
                                        tvn.Text    = book.bookName;
                                        tvn.ToolTip = book.bookName;
                                        tvn.Attributes.Add("isBook", "true");
                                        tvn.ImageUrl = "~/App_Themes/" + StyleSheetTheme + "/Images/TreeView/Book.gif";

                                        tvView.FindNodeById("knowledge" + knowledge.KnowledgeId.ToString()).Nodes.Add(tvn);

                                        //Ìí¼ÓÕ½Ú
                                        BookChapterBLL bookChapterBLL = new BookChapterBLL();
                                        IList <RailExam.Model.BookChapter> bookChapterList = bookChapterBLL.GetBookChapterByBookID(book.bookId);

                                        if (bookChapterList.Count > 0)
                                        {
                                            foreach (RailExam.Model.BookChapter bookChapter in bookChapterList)
                                            {
                                                tvn         = new TreeViewNode();
                                                tvn.ID      = "chapter" + bookChapter.ChapterId.ToString();
                                                tvn.Value   = bookChapter.BookId.ToString();
                                                tvn.Text    = bookChapter.ChapterName;
                                                tvn.ToolTip = bookChapter.ChapterName;
                                                tvn.Attributes.Add("isChapter", "true");
                                                tvn.ImageUrl = "~/App_Themes/" + StyleSheetTheme + "/Images/TreeView/Chapter.gif";

                                                if (bookChapter.ParentId == 0)
                                                {
                                                    tvView.FindNodeById("book" + bookChapter.BookId).Nodes.Add(tvn);
                                                }
                                                else
                                                {
                                                    tvView.FindNodeById("chapter" + bookChapter.ParentId.ToString()).Nodes.Add(tvn);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        catch
                        {
                            tvView.Nodes.Clear();
                            SessionSet.PageMessage = "Êý¾Ý´íÎó£¡";
                            return;
                        }
                    }
                }
            }

            #endregion
        }
        private void BindKnowledgeTree()
        {
            KnowledgeBLL knowledgeBLL = new KnowledgeBLL();
            IList <RailExam.Model.Knowledge> knowledgeList = knowledgeBLL.GetKnowledges();

            if (knowledgeList.Count > 0)
            {
                TreeViewNode tvn     = null;
                string       strflag = Request.QueryString.Get("flag");

                foreach (RailExam.Model.Knowledge knowledge in knowledgeList)
                {
                    tvn         = new TreeViewNode();
                    tvn.ID      = knowledge.KnowledgeId.ToString();
                    tvn.Value   = knowledge.IdPath;
                    tvn.Text    = knowledge.KnowledgeName;
                    tvn.ToolTip = knowledge.KnowledgeName;
                    tvn.Attributes.Add("isKnowledge", "true");
                    tvn.ImageUrl = "~/App_Themes/" + StyleSheetTheme + "/Images/TreeView/Knowledge.gif";

                    if (strflag != null)
                    {
                        if (strflag == "2")
                        {
                            string strPostID = Request.QueryString.Get("PostID");
                            string strOrgID  = Request.QueryString.Get("OrgID");
                            string strLeader = Request.QueryString.Get("Leader");
                            string strTech   = Request.QueryString.Get("Tech");
                            tvn.ContentCallbackUrl = "~/Common/GetKnowledgeBook.aspx?itemTypeID=" + ViewState["ItemType"].ToString() + "&flag=2&id=" + knowledge.KnowledgeId + "&OrgID=" + strOrgID + "&PostID=" + strPostID + "&Leader=" + strLeader + "&Tech=" + strTech;
                        }
                        else if (strflag == "3")
                        {
                            tvn.ContentCallbackUrl = "~/Common/GetKnowledgeBook.aspx?itemTypeID=" + ViewState["ItemType"].ToString() + "&flag=3&id=" + knowledge.IdPath;
                        }
                        else if (strflag == "4")
                        {
                            string strBookIds = Request.QueryString.Get("bookIds");
                            tvn.ContentCallbackUrl = "~/Common/GetKnowledgeBook.aspx?itemTypeID=" + ViewState["ItemType"].ToString() + "&flag=4&item=no&id=" + knowledge.IdPath + "&bookIds=" + strBookIds;
                        }
                        else
                        {
                            tvn.ContentCallbackUrl = "~/Common/GetKnowledgeBook.aspx?itemTypeID=" + ViewState["ItemType"].ToString() + "&flag=1&id=" + knowledge.IdPath;
                        }
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(Request.QueryString.Get("RandomExamID")))
                        {
                            tvn.ContentCallbackUrl = "~/Common/GetKnowledgeBook.aspx?RandomExamID=" + Request.QueryString.Get("RandomExamID") + "&itemTypeID=" + ViewState["ItemType"].ToString() + "&id=" + knowledge.IdPath;
                        }
                        else
                        {
                            tvn.ContentCallbackUrl = "~/Common/GetKnowledgeBook.aspx?itemTypeID=" + ViewState["ItemType"].ToString() + "&id=" + knowledge.IdPath;
                        }
                    }

                    if (knowledge.ParentId == 0)
                    {
                        tvBookChapter.Nodes.Add(tvn);
                    }
                    else
                    {
                        try
                        {
                            tvBookChapter.FindNodeById(knowledge.ParentId.ToString()).Nodes.Add(tvn);
                        }
                        catch
                        {
                            tvBookChapter.Nodes.Clear();
                            SessionSet.PageMessage = "Êý¾Ý´íÎó£¡";
                            return;
                        }
                    }
                }
            }
            //tvBookChapter.DataBind();
            //tvBookChapter.ExpandAll();
        }
예제 #10
0
        // 手动绑定KNOWLEDGE TreeView
        private void KnowledgeTreeNodeBind(int?postID, string whereClause, TreeViewNode tvNode)
        {
            ComponentArt.Web.UI.TreeView virtualTree = new ComponentArt.Web.UI.TreeView();

            KnowledgeBLL knowledgeBLL = new KnowledgeBLL();
            IList <RailExam.Model.Knowledge> knowledgeList;

            if (String.IsNullOrEmpty(whereClause))
            {
                knowledgeList = knowledgeBLL.GetKnowledges();
            }
            else
            {
                knowledgeList = knowledgeBLL.GetKnowledgesByWhereClause(whereClause, "level_num, order_index");
            }
            if (knowledgeList.Count > 0)
            {
                TreeViewNode tvn = null;

                foreach (RailExam.Model.Knowledge knowledge in knowledgeList)
                {
                    tvn         = new TreeViewNode();
                    tvn.ID      = knowledge.KnowledgeId.ToString();
                    tvn.Value   = postID == null ? String.Empty : postID.ToString();
                    tvn.Text    = knowledge.KnowledgeName;
                    tvn.ToolTip = knowledge.KnowledgeName;

                    if (knowledge.ParentId == 0)
                    {
                        if (tvNode == null)
                        {
                            this.tvKnowledge.Nodes.Add(tvn);
                        }
                        else
                        {
                            virtualTree.Nodes.Add(tvn);
                        }
                    }
                    else
                    {
                        try
                        {
                            if (tvNode == null)
                            {
                                tvKnowledge.FindNodeById(knowledge.ParentId.ToString()).Nodes.Add(tvn);
                            }
                            else
                            {
                                virtualTree.FindNodeById(knowledge.ParentId.ToString()).Nodes.Add(tvn);
                            }
                        }
                        catch
                        {
                            tvKnowledge.Nodes.Clear();
                            return;
                        }
                    }
                }

                if (tvNode != null)
                {
                    foreach (TreeViewNode node in virtualTree.Nodes)
                    {
                        tvNode.Nodes.Add(node);
                    }
                }
            }
        }
예제 #11
0
        private void BindKnowledgeTree(string strAll)
        {
            #region Bind knowledge tree

            KnowledgeBLL knowledgeBLL = new KnowledgeBLL();

            IList <RailExam.Model.Knowledge> knowledgeList = new List <RailExam.Model.Knowledge>();

            if (strAll == "ALL")
            {
                knowledgeList = knowledgeBLL.GetKnowledges();
            }
            else
            {
                if (PrjPub.CurrentLoginUser.SuitRange == 1)
                {
                    knowledgeList = knowledgeBLL.GetKnowledges();
                }
                else
                {
                    knowledgeList = knowledgeBLL.GetKnowledgesByOrgID(PrjPub.CurrentLoginUser.StationOrgID);
                }
            }

            if (knowledgeList.Count > 0)
            {
                TreeViewNode tvn = null;

                foreach (RailExam.Model.Knowledge knowledge in knowledgeList)
                {
                    tvn         = new TreeViewNode();
                    tvn.ID      = knowledge.KnowledgeId.ToString();
                    tvn.Value   = knowledge.IdPath;
                    tvn.Text    = knowledge.KnowledgeName;
                    tvn.ToolTip = knowledge.KnowledgeName;
                    tvn.Attributes.Add("isKnowledge", "true");
                    tvn.ImageUrl           = "~/App_Themes/" + StyleSheetTheme + "/Images/TreeView/Knowledge.gif";
                    tvn.ContentCallbackUrl = "../Common/GetKnowledgeBook.aspx?item=no&source=itemlist&id=" + knowledge.IdPath + "&postId=" + hfPostID.Value;

                    if (knowledge.ParentId == 0)
                    {
                        tvView.Nodes.Add(tvn);
                    }
                    else
                    {
                        try
                        {
                            tvView.FindNodeById(knowledge.ParentId.ToString()).Nodes.Add(tvn);
                        }
                        catch
                        {
                            tvView.Nodes.Clear();
                            SessionSet.PageMessage = "数据错误!";

                            return;
                        }
                    }
                }
            }
            //tvView.DataBind();
            //tvView.ExpandAll();

            #endregion
        }