duheng
2024-09-20 8a8983dd2053b631c559b257b1501d740bedf4a5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using DevExpress.Dialogs.Core.View;
 
namespace HStation.WinFrmUI
{
    public partial class ThreeLinkMatchingCtrl : DevExpress.XtraEditors.XtraUserControl
    {
        public ThreeLinkMatchingCtrl()
        {
            InitializeComponent();
            this.gridView1.SetNormalView(30);
            this.gridView1.OptionsView.ShowDetailButtons = true;
            this.gridView1.OptionsView.ShowGroupPanel = false;
        }
 
        private List<ThreeLinkMatchingViewModel> _allBindingList = null;
 
        public void SetBindingData(List<ThreeLinkMatchingViewModel> threeLinkMatchingViewModels)
        {
            if (threeLinkMatchingViewModels != null)
            {
                _allBindingList = threeLinkMatchingViewModels;
                this.threeLinkMatchingViewModelBindingSource.DataSource = _allBindingList;
            }
        }
 
        public List<ThreeLinkMatchingViewModel> SetMatching(List<ThreeLinkMatchingViewModel> inputs, List<AdaptingManageVmo> alllist)
        {
            if (inputs == null || inputs.Count == 0)
                return null;
            var resultList = new List<ThreeLinkMatchingViewModel>();
            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.threeLinkMatchingViewModelBindingSource.ResetBindings(false);
            return resultList;
        }
    }
}