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);
|
}
|
}
|
}
|
|
|
|
}
|
}
|