| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
-
- 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<SysFunction> sysFunctions = Get(a=>a.Depth==j,a => a.OrderBy(s => s.Sort)).ToList();
- // foreach (var sysFunction in sysFunctions)
- // {
- // sb.Append("<option value=\"" + sysFunction.Id + "\">" + sysFunction.FunctionName + "</option>");
- // }
- // }
-
- // 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<SysFunction> sysFunctions = Get(a => a.Depth == j, a => a.OrderBy(s => s.Sort)).ToList();
- foreach (var sysFunction in sysFunctions)
- {
- if (sysFunction.Id==fatherId)
- {
- sb.Append("<option value=\"" + sysFunction.Id + "\" selected=\"selected\">" + sysFunction.FunctionName + "</option>");
- }
- else
- {
- sb.Append("<option value=\"" + sysFunction.Id + "\">" + sysFunction.FunctionName + "</option>");
- }
- }
- }
- return sb.ToString();
- }
- }
- }
|