From 8981c9f11f01973ddbf9718ff5935ebfe6dc6b40 Mon Sep 17 00:00:00 2001 From: duheng <2784771470@qq.com> Date: 星期五, 20 九月 2024 18:33:13 +0800 Subject: [PATCH] 报错修改 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/02-AsstesFormCtrl/ElbowsMatchingCtrl.cs | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 50 insertions(+), 0 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/02-AsstesFormCtrl/ElbowsMatchingCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/02-AsstesFormCtrl/ElbowsMatchingCtrl.cs index 60421dd..fd003d3 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/02-AsstesFormCtrl/ElbowsMatchingCtrl.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/02-AsstesFormCtrl/ElbowsMatchingCtrl.cs @@ -9,5 +9,55 @@ this.gridView1.OptionsView.ShowDetailButtons = true; this.gridView1.OptionsView.ShowGroupPanel = false; } + + private List<ElbowsMatchingViewModel> _allBindingList = null; + + /// <summary> + /// 鐐瑰嚮浜嬩欢 + /// </summary> + public event Action<string> RowClickEvent; + + public void SetBindingData(List<ElbowsMatchingViewModel> elbowsMatchingViewModels) + { + if (_allBindingList != null) + { + _allBindingList = elbowsMatchingViewModels; + this.elbowsMatchingViewModelBindingSource.DataSource = _allBindingList; + } + } + + public List<ElbowsMatchingViewModel> SetMatching(List<ElbowsMatchingViewModel> inputs, List<AdaptingManageVmo> alllist) + { + if (inputs == null || inputs.Count == 0) + return null; + var resultList = new List<ElbowsMatchingViewModel>(); + foreach (var item in inputs) + { + var result = AsstesAutoMatchingHelper.AutoMatching(item, alllist); + if (result != null) + { + resultList.Add(result); + } + else + { + item.MatchingType = Xhs.eMatchingType.Error; + resultList.Add(result); + } + } + _allBindingList = resultList; + this.elbowsMatchingViewModelBindingSource.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