From 7e5fcbee07c65bed3333eb295d0d5117df46b939 Mon Sep 17 00:00:00 2001 From: duheng <2784771470@qq.com> Date: 星期四, 05 十二月 2024 22:50:28 +0800 Subject: [PATCH] 修改阀门单独匹配 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/08-working/XhsProjectSimulationWorkingPage.cs | 66 +++++++++++++++++++++++++++++++++ 1 files changed, 66 insertions(+), 0 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/08-working/XhsProjectSimulationWorkingPage.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/08-working/XhsProjectSimulationWorkingPage.cs index 4a22fc2..a8b09e0 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/08-working/XhsProjectSimulationWorkingPage.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/08-working/XhsProjectSimulationWorkingPage.cs @@ -9,6 +9,7 @@ using Yw.WinFrmUI.Q3d; using Yw.EPAnet; using Mapster; +using Microsoft.CodeAnalysis.CSharp.Syntax; namespace HStation.WinFrmUI { public partial class XhsProjectSimulationWorkingPage : DocumentPage @@ -18,7 +19,18 @@ InitializeComponent(); this.PageTitle.Caption = "姘村姏妯℃嫙宸ュ喌"; this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; + } + + + /// <summary> + /// 鏇存柊宸ュ喌浜嬩欢 + /// </summary> + public event Action<HydroWorkingVmo> UpdateWorkingEvent; + /// <summary> + /// 绉婚櫎宸ュ喌浜嬩欢 + /// </summary> + public event Action<HydroWorkingVmo> RemoveWorkingEvent; private HStation.Vmo.XhsProjectVmo _project = null;//椤圭洰 private HStation.Vmo.XhsProjectSiteVmo _projectSite = null;//椤圭洰绔� @@ -1712,9 +1724,63 @@ #endregion + #region 鏇存柊宸ュ喌 + //缂栬緫 + private void barBtnEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) + { + if (_hydroInfo == null) + { + return; + } + if (_working == null) + { + return; + } + var dlg = new EditHydroWorkingDlg(); + dlg.SetBindingData(_working); + dlg.ReloadDataEvent += (rhs) => + { + _working = rhs; + this.PageTitle.Caption = $"姘村姏妯℃嫙\r\n{_working.Name}"; + UpdatePageTitle(this.PageGuid, this.PageTitle); + this.UpdateWorkingEvent?.Invoke(_working); + }; + dlg.ShowDialog(); + } + #endregion + #region 鍒犻櫎宸ュ喌 + + //鍒犻櫎 + private async void barBtnDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) + { + if (_hydroInfo == null) + { + return; + } + if (_working == null) + { + return; + } + var bol = XtraMessageBox.Show("璇烽棶鏄惁鍒犻櫎褰撳墠宸ュ喌锛�", "璇㈤棶", MessageBoxButtons.YesNo) == DialogResult.Yes; + if (!bol) + { + return; + } + bol = await BLLFactory<Yw.BLL.HydroWorking>.Instance.DeleteByID(_working.ID); + if (!bol) + { + TipFormHelper.ShowError("鍒犻櫎澶辫触锛�"); + return; + } + this.RemoveWorkingEvent?.Invoke(_working); + TipFormHelper.ShowSucceed("鍒犻櫎鎴愬姛锛�"); + ClosePage(this.PageGuid); + } + + #endregion } -- Gitblit v1.9.3