using System.Collections.Generic; using System.Linq; using System.Text; using YZXYH.Repository.Models; namespace YZXYH.Repository { public partial class SysFunctionRepository { //public string GetFatherInfo() //{ // StringBuilder sb = new StringBuilder(); // for (int i = 0; i <= 3; i++) // { // var j = i; // List sysFunctions = Get(a=>a.Depth==j,a => a.OrderBy(s => s.Sort)).ToList(); // foreach (var sysFunction in sysFunctions) // { // sb.Append(""); // } // } // return sb.ToString(); //} public string GetFatherInfo(string id) { StringBuilder sb = new StringBuilder(); string fatherId = GetSingle(a => a.Id == id)?.FatherID ?? ""; for (int i = 0; i <= 3; i++) { var j = i; List sysFunctions = Get(a => a.Depth == j, a => a.OrderBy(s => s.Sort)).ToList(); foreach (var sysFunction in sysFunctions) { if (sysFunction.Id==fatherId) { sb.Append(""); } else { sb.Append(""); } } } return sb.ToString(); } } }