using HStation.Vmo;
namespace HStation.WinFrmUI
{
public partial class XhsProjectSimulationInfoPage : DocumentPage
{
public XhsProjectSimulationInfoPage()
{
InitializeComponent();
this.PageTitle.Caption = "项目概况";
this.PageTitle.HeaderSvgImage = this.svgImg32[0];
}
private XhsProjectVmo _project = null;//项目
private XhsProjectSiteVmo _projectSite = null;//项目站
private Yw.Model.HydroModelInfo _hydroInfo = null;//水力信息
///
/// 绑定数据
///
public async Task SetBindingData
(
XhsProjectVmo project,
XhsProjectSiteVmo projectSite,
Yw.Model.HydroModelInfo hydroInfo
)
{
if (project == null)
{
return;
}
_project = project;
_projectSite = projectSite;
_hydroInfo = hydroInfo;
if (_projectSite == null)
{
_projectSite = await BLLFactory.Instance.GetDefaultByProjectID(_project.ID);
}
if (_hydroInfo == null)
{
var hydroRelation = await BLLFactory.Instance
.GetDefaultByObjectTypeAndObjectIDOfPurpose(HStation.Xhs.DataType.XhsProjectSite, _projectSite.ID, HStation.Xhs.Purpose.Simulation);
_hydroInfo = await BLLFactory.Instance.GetByID(hydroRelation.ModelID);
}
}
///
/// 初始化数据
///
public override async void InitialDataSource()
{
base.InitialDataSource();
if (_project == null)
{
return;
}
this.PageTitle.Caption = $"{_project.Name}\r\n项目概况";
this.xhsProjectSimulationProjectInfoCtrl1.SetBindingData(_project);
await this.xhsProjectSimulationBimfaceInfoCtrl1.SetBindingData(_project, _projectSite);
await this.xhsProjectSimulationHydroInfoCtrl1.SetBindingData(_project, _projectSite, _hydroInfo);
}
}
}