lixiaojun
2024-09-24 1716b1da53462a010699c2af750afde753b44df6
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
50
51
52
53
54
55
56
57
58
59
60
using DevExpress.XtraEditors;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
 
namespace HStation.WinFrmUI
{
    public partial class XhsProjectSimulationHydroCheckFailedCtrl : DevExpress.XtraEditors.XtraUserControl
    {
        public XhsProjectSimulationHydroCheckFailedCtrl()
        {
            InitializeComponent();
            this.gridView1.SetNormalView(30);
            this.gridView1.RegistCustomDrawRowIndicator(40);
        }
 
        /// <summary>
        /// 点击构件事件
        /// </summary>
        public event Action<string> HydroClickEvent;
 
        private List<XhsProjectSimulationHydroCheckFailedViewModel> _allBindingList = null;
 
        /// <summary>
        /// 绑定数据
        /// </summary>
        public void SetBindingData(List<Yw.EPAnet.CheckFailed> allFailedList)
        {
            _allBindingList = new List<XhsProjectSimulationHydroCheckFailedViewModel>();
            if (allFailedList != null && allFailedList.Count > 0)
            {
                foreach (var failed in allFailedList)
                {
                    var vm = new XhsProjectSimulationHydroCheckFailedViewModel(failed);
                    _allBindingList.Add(vm);
                }
            }
            this.xhsProjectSimulationHydroCheckFailedViewModelBindingSource.DataSource = _allBindingList;
            this.xhsProjectSimulationHydroCheckFailedViewModelBindingSource.ResetBindings(false);
        }
 
        private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
        {
            var row = this.gridView1.GetRow(e.RowHandle) as XhsProjectSimulationHydroCheckFailedViewModel;
            if (row == null)
            {
                return;
            }
            this.HydroClickEvent?.Invoke(row.ParterId);
        }
 
 
    }
}