From 9c8743941f556a486ba2cc5bcb8a7a6ec1079d0a Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期四, 26 九月 2024 11:55:07 +0800 Subject: [PATCH] Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/02-AsstesFormCtrl/FourLinkMatchingCtrl.cs | 40 +++++++++++++++++++++++++++++++--------- 1 files changed, 31 insertions(+), 9 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/02-AsstesFormCtrl/FourLinkMatchingCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/02-AsstesFormCtrl/FourLinkMatchingCtrl.cs index 97541ce..53a77a9 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/02-AsstesFormCtrl/FourLinkMatchingCtrl.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/02-AsstesFormCtrl/FourLinkMatchingCtrl.cs @@ -10,14 +10,22 @@ this.gridView1.OptionsView.ShowGroupPanel = false; } - private List<FourLinkMatchingViewModel> _allBindingList = null; + private List<FourLinkFormViewModel> _allBindingList = new List<FourLinkFormViewModel>(); + + /// <summary> + /// 鐐瑰嚮浜嬩欢 + /// </summary> + public event Action<string> RowClickEvent; public void SetBindingData(List<FourLinkMatchingViewModel> fourLinkMatchingViewModels) { - if (_allBindingList != null) + if (fourLinkMatchingViewModels != null) { - _allBindingList = fourLinkMatchingViewModels; - this.fourLinkMatchingViewModelBindingSource.ResetBindings(false); + foreach (var item in fourLinkMatchingViewModels) + { + _allBindingList.Add(new FourLinkFormViewModel(item)); + } + this.fourLinkFormViewModelBindingSource.ResetBindings(false); } } @@ -28,20 +36,34 @@ var resultList = new List<FourLinkMatchingViewModel>(); foreach (var item in inputs) { - var result = AsstesAutoMatchingHelper.AutoMatching(item, alllist); + var result = AssetsMatchingHelper.MatchingFourLink(item, alllist); if (result != null) { resultList.Add(result); } else { - item.MatchingType = Xhs.eMatchingType.Error; - resultList.Add(result); + resultList.Add(item); } } - _allBindingList = resultList; - this.fourLinkMatchingViewModelBindingSource.ResetBindings(false); + _allBindingList.Clear(); + foreach (var item in resultList) + { + _allBindingList.Add(new FourLinkFormViewModel(item)); + } + this.fourLinkFormViewModelBindingSource.ResetBindings(false); return resultList; } + + //琛岀偣鍑讳簨浠� + private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) + { + var row = this.gridView1.GetCurrentViewModel(_allBindingList); + if (row == null) + { + return; + } + this.RowClickEvent?.Invoke(row.Code); + } } } \ No newline at end of file -- Gitblit v1.9.3