ningshuxia
2025-04-21 018bfb9c78088d9cd7b9371edcd2102abd594b4d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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; }
        }
    }
}