当前位置: 首页>>代码示例>>C#>>正文


C# Tree.GetTreeNodePath方法代码示例

本文整理汇总了C#中Tree.GetTreeNodePath方法的典型用法代码示例。如果您正苦于以下问题:C# Tree.GetTreeNodePath方法的具体用法?C# Tree.GetTreeNodePath怎么用?C# Tree.GetTreeNodePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tree的用法示例。


在下文中一共展示了Tree.GetTreeNodePath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ToKnowledgeModify

 public ActionResult ToKnowledgeModify(string ariticleId)
 {
     using (RRDLEntities db = new RRDLEntities())
     {
         AriticleService ars = new AriticleService(db);
         Ariticle ariticle = ars.FindById(ariticleId);
         AriticleViewModel avm = new AriticleViewModel(ariticle);
         List<AriticleVisibility> visibilityList = ars.GetAriticleVisibility(ariticle.Id);
         avm.Id = ariticle.Id;
         string result = JsonConvert.SerializeObject(avm);
         ViewBag.Ariticle = result;
         UserGroupService ugs = new UserGroupService();
         List<UserGroup> list = ugs.FindAll();
         List<UserGroupViewModel> ugvlist = new List<UserGroupViewModel>();
         UserGroupViewModel ugv;
         for (int i = 0; i < list.Count; i++)
         {
             ugv = new UserGroupViewModel(list[i]);
             ugvlist.Add(ugv);
         }
         string resultlist = JsonConvert.SerializeObject(ugvlist);
         ViewBag.OpenString = resultlist;
         Tree tree = new Tree();
         TreeNode treeNode = tree.SearchByAriticle(ariticle.Id);
         List<TreeNode> treelist = tree.GetTreeNodePath(treeNode);
         string treeresult = "";
         for (int i = treelist.Count - 1; i >= 0; i--)
         {
             treeresult = treeresult + treelist[i].Title + "TreePathSplit";
         }
         ViewBag.TreeId = treeNode.ParentId;
         ViewBag.TreePath = treeresult;
         VisibilityViewModel vvm = new VisibilityViewModel();
         List<VisibilityViewModel> vvlist = new List<VisibilityViewModel>();
         int count = ugs.FindAll().Count;
         if (count == visibilityList.Count)
         {
             ViewBag.visibilityList = "all";
         }
         else
         {
             for (int i = 0; i < visibilityList.Count; i++)
             {
                 vvm = new VisibilityViewModel();
                 vvm.Id = visibilityList[i].Id;
                 vvm.UserGroupId = visibilityList[i].UserGroupId;
                 vvlist.Add(vvm);
             }
             string vlist = JsonConvert.SerializeObject(vvlist);
             ViewBag.visibilityList = vlist;
         }
         string author = ariticle.User.NickName;
         string createTime = ariticle.Createtime.ToString();
         ViewBag.author = author;
         ViewBag.createTime = createTime;
         return View();
     }
 }
开发者ID:hiyouth,项目名称:R2.RRDL,代码行数:58,代码来源:PersonalCenterController.cs

示例2: getTreePath

 //获取树的路径
 public string getTreePath(string treeNode) {
     Tree tree = new Tree();
     TreeNode tn = tree.GetTreeNodeById(Int32.Parse(treeNode));
     List<TreeNode> list = tree.GetTreeNodePath(tn);
     string result = "";
     for (int i = list.Count-1; i >= 0 ;i-- )
     {
         result = result + list[i].Title + "TreeSplit";
     }
     return result;
 }
开发者ID:hiyouth,项目名称:R2.RRDL,代码行数:12,代码来源:TreeViewController.cs

示例3: GetAriticleById

 public ActionResult GetAriticleById(string ariticleId)
 {
     using (RRDLEntities db = new RRDLEntities())
     {
         AriticleService ars = new AriticleService(db);
         Ariticle ariticle = ars.FindById(ariticleId);
         AriticleViewModel avm = new AriticleViewModel(ariticle);
         avm.Title = ariticle.Title;
         avm.UGC = ariticle.UGC;
         avm.author = ariticle.User.NickName;
         avm.Createtime = ariticle.Createtime.ToString();
         Tree tree = new Tree();
         TreeNode treeNode = tree.SearchByAriticle(ariticle.Id);
         List<TreeNode> list = tree.GetTreeNodePath(treeNode);
         string result = "";
         for (int i = list.Count - 1; i >= 0; i--)
         {
             result = result + list[i].Title + "#";
         }
         string arrayList = "";
         List<AriticleVisibility> visibilityList = ars.GetAriticleVisibility(ariticle.Id);
         UserGroupService ugs = new UserGroupService();
         int count = ugs.FindAll().Count;
         if (0 == visibilityList.Count)
         {
             arrayList = JsonConvert.SerializeObject(avm) + "AriticleAndTreeNode" + result + "AriticleAndTreeNodeall";
         }
         else {
             VisibilityViewModel vvm = new VisibilityViewModel();
             List<VisibilityViewModel> vvlist = new List<VisibilityViewModel>();
             for (int i = 0; i < visibilityList.Count; i++)
             {
                 vvm = new VisibilityViewModel();
                 vvm.Id = visibilityList[i].Id;
                 vvm.UserGroupId = visibilityList[i].UserGroupId;
                 vvm.userGroupTitle = visibilityList[i].UserGroup.Title;
                 vvlist.Add(vvm);
             }
             string vlist = JsonConvert.SerializeObject(vvlist);
             arrayList = JsonConvert.SerializeObject(avm) + "AriticleAndTreeNode" + result + "AriticleAndTreeNode" + vlist;
         }
         return Content(arrayList);
     }
 }
开发者ID:hiyouth,项目名称:R2.RRDL,代码行数:44,代码来源:ManageModuleController.cs


注:本文中的Tree.GetTreeNodePath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。