duheng
2024-09-26 a6c50c87d1ba3f5c8785dcc9e8ea640b5a43209f
WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/01-info/XhsProjectSimulationInfoPage.cs
@@ -13,11 +13,17 @@
        private XhsProjectVmo _project = null;//项目
        private XhsProjectSiteVmo _projectSite = null;//项目站
        private Yw.Model.HydroModelInfo _hydroInfo = null;//水力信息
        /// <summary>
        /// 绑定数据
        /// </summary>
        public async Task SetBindingData(XhsProjectVmo project, XhsProjectSiteVmo projectSite)
        public async Task SetBindingData
            (
                XhsProjectVmo project,
                XhsProjectSiteVmo projectSite,
                Yw.Model.HydroModelInfo hydroInfo
            )
        {
            if (project == null)
            {
@@ -25,9 +31,16 @@
            }
            _project = project;
            _projectSite = projectSite;
            _hydroInfo = hydroInfo;
            if (_projectSite == null)
            {
                _projectSite = await BLLFactory<HStation.BLL.XhsProjectSite>.Instance.GetDefaultByProjectID(_project.ID);
            }
            if (_hydroInfo == null)
            {
                var hydroRelation = await BLLFactory<Yw.BLL.HydroModelRelation>.Instance
                    .GetDefaultByObjectTypeAndObjectIDOfPurpose(HStation.Xhs.DataType.XhsProjectSite, _projectSite.ID, HStation.Xhs.Purpose.Simulation);
                _hydroInfo = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.GetByID(hydroRelation.ModelID);
            }
        }
@@ -45,6 +58,7 @@
            this.PageTitle.Caption = $"{_project.Name}\r\n项目概况";
            this.xhsProjectSimulationProjectInfoCtrl1.SetBindingData(_project);
            await this.xhsProjectSimulationBimfaceInfoCtrl1.SetBindingData(_project, _projectSite);
            await this.xhsProjectSimulationHydroInfoCtrl1.SetBindingData(_project, _projectSite, _hydroInfo);
        }