| | |
| | | this.gridView1.OptionsView.ShowGroupPanel = false; |
| | | } |
| | | |
| | | private List<PipeLineMatchingViewModel> _allBindingList = null; |
| | | private List<PipeLineFormViewModel> _allBindingList = new List<PipeLineFormViewModel>(); |
| | | |
| | | public List<PipeLineMatchingViewModel> SetBindingData(List<PipeLineMatchingViewModel> inputs, List<PipeLineManageVmo> alllist) |
| | | /// <summary> |
| | | /// 点击事件 |
| | | /// </summary> |
| | | public event Action<string> RowClickEvent; |
| | | |
| | | public void SetBindingData(List<PipeLineMatchingViewModel> pipeLineMatchingViewModels) |
| | | { |
| | | if (pipeLineMatchingViewModels != null) |
| | | { |
| | | foreach (var item in pipeLineMatchingViewModels) |
| | | { |
| | | _allBindingList.Add(new PipeLineFormViewModel(item)); |
| | | } |
| | | this.pipeLineFormViewModelBindingSource.DataSource = _allBindingList; |
| | | } |
| | | } |
| | | |
| | | public List<PipeLineMatchingViewModel> SetMatching(List<PipeLineMatchingViewModel> inputs, List<PipeLineManageVmo> alllist) |
| | | { |
| | | if (inputs == null) |
| | | { |
| | |
| | | var finishList = new List<PipeLineMatchingViewModel>(); |
| | | foreach (var item in inputs) |
| | | { |
| | | var result = AsstesAutoMatchingHelper.PipeAutoMatching(item, alllist); |
| | | var result = AssetsMatchingHelper.MatchingPipes(item, alllist); |
| | | if (result != null) |
| | | { |
| | | finishList.Add(result); |
| | | } |
| | | else |
| | | { |
| | | finishList.Add(item); |
| | | } |
| | | } |
| | | _allBindingList = finishList; |
| | | this.pipeLineMatchingViewModelBindingSource.DataSource = _allBindingList; |
| | | this.pipeLineMatchingViewModelBindingSource.ResetBindings(false); |
| | | _allBindingList.Clear(); |
| | | foreach (var item in finishList) |
| | | { |
| | | _allBindingList.Add(new PipeLineFormViewModel(item)); |
| | | } |
| | | this.pipeLineFormViewModelBindingSource.ResetBindings(false); |
| | | return finishList; |
| | | } |
| | | |
| | | //行点击事件 |
| | | 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); |
| | | } |
| | | } |
| | | } |