lixiaojun
2023-10-11 1d86ecdc56c4395c5abaffa45e53e957054b348b
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
namespace IStation.Application
{
    /// <summary>
    /// 
    /// </summary>
    public class AirpSiteLogicalTreeDto : LogicalTreeDto
    {
        /// <summary>
        /// 
        /// </summary>
        public AirpSiteLogicalTreeDto(Model.AirpSite rhs)
        {
            this.Id = $"{IStation.DataType.AirpSite}_{rhs.ID}";
            this.ParentId = $"{IStation.DataType.Tenant}_{rhs.TenantID}";
            this.LogicalName = rhs.Name;
            this.LogicalID = rhs.ID;
            this.LogicalType = IStation.DataType.AirpSite;
            this.LogicalModel = new AirpSiteStdDto(rhs);
            this.SortCode = rhs.SortCode;
            this.Description = rhs.Description;
            this.Children = new List<LogicalTreeDto>();
        }
 
        /// <summary>
        /// 
        /// </summary>
        public AirpSiteLogicalTreeDto(Model.Tenant rhs, List<Model.AirpSite> airpSiteList = null)
        {
            this.Id = $"{IStation.DataType.Tenant}_{rhs.ID}";
            this.ParentId = string.Empty;
            this.LogicalName = rhs.Name;
            this.LogicalID = rhs.ID;
            this.LogicalType = IStation.DataType.Tenant;
            this.LogicalModel = new TenantStdDto(rhs);
            this.SortCode = rhs.SortCode;
            this.Description = rhs.Description;
            this.Children = new List<LogicalTreeDto>();
 
            if (airpSiteList != null && airpSiteList.Count > 0)
            {
                foreach (var airpSite in airpSiteList)
                {
                    var child = new AirpSiteLogicalTreeDto(airpSite);
                    child.ParentId = this.Id;
                    this.Children.Add(child);
                }
            }
        }
 
 
 
    }
}