duheng
2024-09-20 7d17fabc46e87ea0f0896f760034f4d16a4dfed0
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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;//水力信息
 
        /// <summary>
        /// 绑定数据
        /// </summary>
        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<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);
            }
        }
 
 
        /// <summary>
        /// 初始化数据
        /// </summary>
        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);
        }
 
 
 
 
 
    }
}