using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Yw; using Yw.Basic; namespace HStation.WinFrmUI { public class SysTypeHelper { public static async Task> GetSysTypeTreeList() { var allModule = await BLLFactory.Instance.GetAll(); var allType = await BLLFactory.Instance.GetAll(); var sysTypeList = new List(); if (allModule != null) { foreach (var module in allModule) { var model = new SysTypeTreeList(); model.Module = module; model.Children = new List(); if (allType != null) { foreach (var item in allType) { if (item.ModuleID == module.ID) { model.Children.Add(item); } } } sysTypeList.Add(model); } } return sysTypeList; } public static async Task> GetSysTypeTreeListByExtendType(eExtendType eExtendType) { var allModule = await BLLFactory.Instance.GetAll(); var allType = await BLLFactory.Instance.GetAll(); var sysTypeList = new List(); if (allModule != null) { foreach (var module in allModule) { var model = new SysTypeTreeList(); model.Module = module; model.Children = new List(); if (allType != null) { foreach (var item in allType) { if (item.ModuleID == module.ID) { if (item.ExtendType == eExtendType) { model.Children.Add(item); } } } } sysTypeList.Add(model); } } return sysTypeList; } public class SysTypeTreeList { public Yw.Vmo.SysModuleVmo Module { get; set; } public List Children { get; set; } } } }