private void PopulateTreeNodes(List<CourseItem> LstCourseItem, TreeNodeCollection RootNodes) { foreach (CourseItem ObjCourseItem in LstCourseItem) { TreeNode NodeToAdd = new TreeNode(); if (ObjCourseItem.ItemType.ToString() == ECourseItemType.Plugg.ToString()) { BaseHandler plugghandler = new BaseHandler(); PluggContainer p = new PluggContainer(); p.ThePlugg = plugghandler.GetPlugg(ObjCourseItem.ItemId); string curlan = (Page as PageBase).PageCulture.Name; p.CultureCode = curlan; p.LoadTitle(); NodeToAdd.Text = "<a style='text-decoration: underline;cursor: pointer; ' href='/" + ObjCourseItem.ItemId + "' >" + p.TheTitle.Text + "</a>"; } else { NodeToAdd.Text = Convert.ToString(ObjCourseItem.label); } NodeToAdd.SelectAction = TreeNodeSelectAction.None; RootNodes.Add(NodeToAdd); if (ObjCourseItem.children != null) PopulateTreeNodes((List<CourseItem>)ObjCourseItem.children, NodeToAdd.ChildNodes); } }
private PluggContainer GetPluggContainer(string curlan) { BaseHandler plugghandler = new BaseHandler(); int pluggid = Convert.ToInt32(((DotNetNuke.Framework.CDefault)this.Page).Title); PluggContainer p = new PluggContainer(); p.ThePlugg = plugghandler.GetPlugg(pluggid); p.CultureCode = curlan; p.LoadTitle(); return p; }