using Yw;
|
using Yw.Basic;
|
|
namespace HStation.WinFrmUI
|
{
|
public class SysTypeHelper
|
{
|
public static async Task<List<SysTypeTreeList>> GetSysTypeTreeList()
|
{
|
var allModule = await BLLFactory<Yw.BLL.SysModule>.Instance.GetAll();
|
var allType = await BLLFactory<Yw.BLL.SysType>.Instance.GetAll();
|
var sysTypeList = new List<SysTypeTreeList>();
|
if (allModule != null)
|
{
|
foreach (var module in allModule)
|
{
|
var model = new SysTypeTreeList();
|
model.Module = module;
|
model.Children = new List<Yw.Vmo.SysTypeVmo>();
|
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<List<SysTypeTreeList>> GetSysTypeTreeListByExtendType(eExtendType eExtendType)
|
{
|
var allModule = await BLLFactory<Yw.BLL.SysModule>.Instance.GetAll();
|
var allType = await BLLFactory<Yw.BLL.SysType>.Instance.GetAll();
|
var sysTypeList = new List<SysTypeTreeList>();
|
if (allModule != null)
|
{
|
foreach (var module in allModule)
|
{
|
var model = new SysTypeTreeList();
|
model.Module = module;
|
model.Children = new List<Yw.Vmo.SysTypeVmo>();
|
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<Yw.Vmo.SysTypeVmo> Children { get; set; }
|
}
|
}
|
}
|