public void AddChildren(EntityTree parentEn, EntitiesTree ens) { appendMenus.Append(appendMenuSb); appendMenuSb.Clear(); appendMenuSb.Append("["); foreach (EntityTree item in ens) { if (item.ParentNo != parentEn.No) { continue; } appendMenuSb.Append("{'id':'" + item.No + "','pid':'" + item.ParentNo + "','text':'" + item.Name + "'"); //appendMenuSb.Append(IsPermissionsNodes(ens, dms, item.No)); EntityTree treeNode = item as EntityTree; // 增加它的子级. appendMenuSb.Append(",'children':"); AddChildren(item, ens); appendMenuSb.Append("},"); } if (appendMenuSb.Length > 1) { appendMenuSb = appendMenuSb.Remove(appendMenuSb.Length - 1, 1); } appendMenuSb.Append("]"); appendMenus.Append(appendMenuSb); appendMenuSb.Clear(); }
/// <summary> /// 获取它的子节点 /// </summary> /// <param name="en"></param> /// <returns></returns> public EntitiesTree GenerHisChinren(EntityTree en) { EntitiesTree ens = this.CreateInstance() as EntitiesTree; foreach (EntityTree item in ens) { if (en.ParentNo == en.No) { ens.AddEntity(item); } } return(ens); }
/// <summary> /// 增加一个属性 /// </summary> /// <param name="_ensOfMM">多对多的实体</param> /// <param name="_ensOfM">多实体</param> /// <param name="AttrOfOneInMM">点实体,在MM中的属性</param> /// <param name="AttrOfMInMM">多实体主键在MM中的属性</param> /// <param name="AttrOfMText"></param> /// <param name="AttrOfMValue"></param> /// <param name="desc">描述</param> public void Add(Entities _ensOfMM, Entities _ensOfM, string AttrOfOneInMM, string AttrOfMInMM, string AttrOfMText, string AttrOfMValue, string desc, Dot2DotModel model = Dot2DotModel.Default, EntitiesTree ensTree = null, string refTreeAttr = null) { //属性. AttrOfOneVSM en = new AttrOfOneVSM(_ensOfMM, _ensOfM, AttrOfOneInMM, AttrOfMInMM, AttrOfMText, AttrOfMValue, desc); //工作模式. en.Dot2DotModel = model; en.EnsTree = ensTree; en.RefTreeAttr = refTreeAttr; this.Add(en); }