From 6f8c6a3b2277b92a24319f672811da113861cfc1 Mon Sep 17 00:00:00 2001 From: duheng <2784771470@qq.com> Date: 星期一, 23 九月 2024 10:42:30 +0800 Subject: [PATCH] 提交缺少修改 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/AssetsMainChoicePage.cs | 71 ++++++++++++++++++++++++++++++----- 1 files changed, 61 insertions(+), 10 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/AssetsMainChoicePage.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/AssetsMainChoicePage.cs index 3dc3db6..634cc5e 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/AssetsMainChoicePage.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/AssetsMainChoicePage.cs @@ -5,7 +5,22 @@ public AssetsMainChoicePage() { InitializeComponent(); + this.elbowsMatchingCtrl1.RowClickEvent += RowClickEvent; + this.fourLinkMatchingCtrl1.RowClickEvent += RowClickEvent; + this.pipeLineMatchingCtrl1.RowClickEvent += RowClickEvent; + this.pumpMatchingCtrl1.RowClickEvent += RowClickEvent; + this.threeLinkMatchingCtrl1.RowClickEvent += RowClickEvent; + this.valveMatchingCtrl1.RowClickEvent += RowClickEvent; } + + private void RowClickEvent(string code) + { + FormRowClickEvent.Invoke(code); + } + + public event Action<string> FormRowClickEvent = null; + + public event Func<AssetsAutoMatchingViewModel, bool> RelaodEvent = null; private BLL.PumpMain _pumpMain = null; @@ -15,11 +30,27 @@ private BLL.ValveMain _valveMain = null; - /// <summary> - /// 鍒濆鍖� - /// </summary> - public async Task<AssetsAutoMatchingInputViewModel> SetMatching(AssetsAutoMatchingInputViewModel input) + private AssetsAutoMatchingViewModel _assetsAutoMatching = null; + + public async void SetBindingData(AssetsAutoMatchingViewModel inputViewModel) { + _assetsAutoMatching = inputViewModel; + this.elbowsMatchingCtrl1.SetBindingData(inputViewModel.ElbowsMatchingModels); + this.pipeLineMatchingCtrl1.SetBindingData(inputViewModel.PipeLineMatchingModels); + this.pumpMatchingCtrl1.SetBindingData(inputViewModel.PumpMatchingModels); + this.threeLinkMatchingCtrl1.SetBindingData(inputViewModel.ThreeLinkMatchingModels); + this.fourLinkMatchingCtrl1.SetBindingData(inputViewModel.FourLinkMatchingModels); + this.valveMatchingCtrl1.SetBindingData(inputViewModel.ValveMatchingModels); + await SetMatching(inputViewModel); + } + + /// <summary> + /// 鑷姩鍖归厤 + /// </summary> + public async Task<AssetsAutoMatchingViewModel> SetMatching(AssetsAutoMatchingViewModel input) + { + if (input == null) + return null; _pumpMain = new BLL.PumpMain(); _adaptingManage = new BLL.AdaptingManage(); _pipeLineManage = new BLL.PipeLineManage(); @@ -28,20 +59,40 @@ var allAdapting = await _adaptingManage.GetAll(); var allPipeLine = await _pipeLineManage.GetAll(); var allValve = await _valveMain.GetAll(); - var assetsAutoMatching = new AssetsAutoMatchingInputViewModel(); + var assetsAutoMatching = new AssetsAutoMatchingViewModel(); //娉靛尮閰� - var pumpMatching = await this.pumpMatchingCtrl1.SetBindingData(input.PumpMatchingModels, allPump); + var pumpMatching = await this.pumpMatchingCtrl1.SetMatching(input.PumpMatchingModels, allPump); //涓夐�氬尮閰� - var threeLinkMatching = this.threeLinkMatchingCtrl1.SetBindingData(input.ThreeLinkMatchingModels, allAdapting); + var threeLinkMatching = this.threeLinkMatchingCtrl1.SetMatching(input.ThreeLinkMatchingModels, allAdapting); //鍥涢�氬尮閰� - var fourLinkMatching = this.fourLinkMatchingCtrl1.SetBindingData(input.FourLinkMatchingModels, allAdapting); + var fourLinkMatching = this.fourLinkMatchingCtrl1.SetMatching(input.FourLinkMatchingModels, allAdapting); //绠¢亾鍖归厤 - var PipeLineMatching = this.pipeLineMatchingCtrl1.SetBindingData(input.PipeLineMatchingModels, allPipeLine); + var pipeLineMatching = this.pipeLineMatchingCtrl1.SetMatching(input.PipeLineMatchingModels, allPipeLine); //闃�闂ㄥ尮閰� - var ValveMatching = this.valveMatchingCtrl1.SetBindingData(input.ValveMatchingModels, allValve); + var valveMatching = this.valveMatchingCtrl1.SetMatching(input.ValveMatchingModels, allValve); + //寮ご鍖归厤 + var elbowsMatching = this.elbowsMatchingCtrl1.SetMatching(input.ElbowsMatchingModels, allAdapting); + assetsAutoMatching.PumpMatchingModels = pumpMatching; assetsAutoMatching.ThreeLinkMatchingModels = threeLinkMatching; + assetsAutoMatching.FourLinkMatchingModels = fourLinkMatching; + assetsAutoMatching.ElbowsMatchingModels = elbowsMatching; + assetsAutoMatching.PipeLineMatchingModels = pipeLineMatching; + assetsAutoMatching.ValveMatchingModels = valveMatching; return assetsAutoMatching; } + + //纭畾 + private void btnComplete_Click(object sender, EventArgs e) + { + if (RelaodEvent.Invoke(_assetsAutoMatching)) + { + TipFormHelper.ShowSucceed("淇敼鎴愬姛!"); + } + else + { + TipFormHelper.ShowError("淇敼澶辫触!"); + } + } } } \ No newline at end of file -- Gitblit v1.9.3