From c09478fe73685a87de0c48f9b300008f06408dd8 Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期三, 20 十一月 2024 15:15:51 +0800
Subject: [PATCH] 核心界面

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/05-function/XhsProjectSimulationFunctionMgrCtrl.cs |   82 +++++++++++++++++++++++++++++++---------
 1 files changed, 63 insertions(+), 19 deletions(-)

diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/05-function/XhsProjectSimulationFunctionMgrCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/05-function/XhsProjectSimulationFunctionMgrCtrl.cs
index d09f3a0..28fe33e 100644
--- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/05-function/XhsProjectSimulationFunctionMgrCtrl.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/05-function/XhsProjectSimulationFunctionMgrCtrl.cs
@@ -7,35 +7,65 @@
         public XhsProjectSimulationFunctionMgrCtrl()
         {
             InitializeComponent();
+            this.xhsProjectSimulationSchemeMgrCtrl1.ProjectSiteSelectedChangedEvent += XhsProjectSimulationSchemeMgrCtrl1_ProjectSiteSelectedChangedEvent;
+        }
+
+        /// <summary>
+        /// 椤圭洰绔欓�夋嫨鏀瑰彉浜嬩欢
+        /// </summary>
+        public event Action<XhsProjectSiteVmo> ProjectSiteSelectedChangedEvent;
+        /// <summary>
+        /// 鏄剧ず寰幆姘撮」鐩俊鎭簨浠�
+        /// </summary>
+        public event Action<SvgImage> ShowXhsProjectInfoEvent;
+        /// <summary>
+        /// 鏄剧ず寰幆姘撮」鐩按鍔涙ā鎷熶簨浠�
+        /// </summary>
+        public event Action<SvgImage> ShowXhsProjectSimulationEvent;
+        /// <summary>
+        /// 鍒涘缓寰幆姘撮」鐩柟妗堜簨浠�
+        /// </summary>
+        public event Action<SvgImage> CreateXhsProjectSchemeEvent;
+        /// <summary>
+        /// 姣旇緝寰幆姘撮」鐩柟妗堜簨浠�
+        /// </summary>
+        public event Action<SvgImage> CompareXhsProjectSchemeEvent;
+
+        private long _projectId;//椤圭洰id
+        private XhsProjectVmo _project = null;//椤圭洰
+        private XhsProjectSiteVmo _projectSite = null;//椤圭洰绔�
+
+        /// <summary>
+        /// 缁戝畾鏁版嵁
+        /// </summary>
+        public async Task SetBindingData(long projectId)
+        {
+            _projectId = projectId;
+            _project = await BLLFactory<HStation.BLL.XhsProject>.Instance.GetByID(projectId);
+            await SetBindingData(_project);
         }
 
         /// <summary>
         /// 缁戝畾鏁版嵁
         /// </summary>
-        public void SetBindingData()
+        public async Task SetBindingData(XhsProjectVmo project)
         {
-            this.ShowXhsProjectInfoEvent?.Invoke(this.svgImg32[0]);
+            if (project == null)
+            {
+                return;
+            }
+            _project = project;
+            _projectId = project.ID;
+            await this.xhsProjectSimulationSchemeMgrCtrl1.SetBindingData(project);
         }
 
         /// <summary>
-        /// 鏄剧ず寰幆姘撮」鐩俊鎭簨浠�
+        /// 閲嶇疆缁戝畾
         /// </summary>
-        public event Action<SvgImage> ShowXhsProjectInfoEvent;
-
-        /// <summary>
-        /// 鏄剧ず寰幆姘撮」鐩按鍔涙ā鎷熶簨浠�
-        /// </summary>
-        public event Action<SvgImage> ShowXhsProjectSimulationEvent;
-
-        /// <summary>
-        /// 鍒涘缓寰幆姘撮」鐩柟妗堜簨浠�
-        /// </summary>
-        public event Action<SvgImage> CreateXhsProjectSchemeEvent;
-
-        /// <summary>
-        /// 姣旇緝寰幆姘撮」鐩柟妗堜簨浠�
-        /// </summary>
-        public event Action<SvgImage> CompareXhsProjectSchemeEvent;
+        public void ResetBindingData()
+        {
+            this.ShowXhsProjectInfoEvent?.Invoke(this.svgImg32[0]);
+        }
 
         //鍏冪礌鐐瑰嚮浜嬩欢
         private void accordionControl1_ElementClick(object sender, DevExpress.XtraBars.Navigation.ElementClickEventArgs e)
@@ -67,6 +97,20 @@
             }
         }
 
+        //椤圭洰绔欓�夋嫨鏀瑰彉浜嬩欢
+        private void XhsProjectSimulationSchemeMgrCtrl1_ProjectSiteSelectedChangedEvent(XhsProjectSiteVmo obj)
+        {
+            _projectSite = obj;
+            this.ProjectSiteSelectedChangedEvent?.Invoke(obj);
+        }
+
+        /// <summary>
+        /// 娣诲姞鏂规
+        /// </summary>
+        public void AppendScheme(XhsSchemeVmo scheme)
+        {
+            this.xhsProjectSimulationSchemeMgrCtrl1.AppendScheme(scheme);
+        }
 
 
 

--
Gitblit v1.9.3