lixiaojun
2024-12-23 b9c79f595e5ad4684d731f968bf120ff8c52dbd8
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/01-info/XhsProjectSimulationInfoPage.cs
@@ -1,7 +1,4 @@
using HStation.Vmo;
using System.Reflection;
namespace HStation.WinFrmUI
namespace HStation.WinFrmUI
{
    public partial class XhsProjectSimulationInfoPage : DocumentPage
    {
@@ -9,7 +6,7 @@
        {
            InitializeComponent();
            this.PageTitle.Caption = "项目概况";
            this.PageTitle.HeaderSvgImage = this.svgImg32[0];
            //this.PageTitle.HeaderSvgImage = this.svgImg32[0];
        }
        private XhsProjectVmo _project = null;//项目
@@ -19,12 +16,7 @@
        /// <summary>
        /// 绑定数据
        /// </summary>
        public async Task SetBindingData
            (
                XhsProjectVmo project,
                XhsProjectSiteVmo projectSite,
                Yw.Model.HydroModelInfo hydroInfo
            )
        public void SetBindingData(XhsProjectVmo project, XhsProjectSiteVmo projectSite, Yw.Model.HydroModelInfo hydroInfo)
        {
            if (project == null)
            {
@@ -33,18 +25,8 @@
            _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);
            }
            this.PageTitle.Caption = $"项目概况";
        }
        /// <summary>
        /// 初始化数据
@@ -52,11 +34,6 @@
        public override void InitialDataSource()
        {
            base.InitialDataSource();
            if (_project == null)
            {
                return;
            }
            this.PageTitle.Caption = $"{_project.Name}\r\n项目概况";
        }
        private async void widgetView1_QueryControl(object sender, DevExpress.XtraBars.Docking2010.Views.QueryControlEventArgs e)
@@ -79,14 +56,15 @@
                    break;
                case "parter-list-info":
                    {
                        var ctrl = new Yw.WinFrmUI.HydroParterListCtrl();
                        var ctrl = new XhsProjectSimulationHydroInfoCtrl();
                        e.Control = ctrl;
                        ctrl.SetBindingData(_hydroInfo);
                        await ctrl.SetBindingData(_project, _projectSite, _hydroInfo);
                    }
                    break;
                default: break;
            }
        }
    }
}