lixiaojun
2024-09-19 46af162acbf917f039878db200b54112268c4911
WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/02-check/XhsProjectSimulationHydroCheckFailedDlg.cs
@@ -1,23 +1,10 @@
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
namespace HStation.WinFrmUI
{
    public partial class XhsProjectSimulationHydroCheckFailedDlg : DevExpress.XtraEditors.XtraForm
    {
        public XhsProjectSimulationHydroCheckFailedDlg()
        {
            InitializeComponent();
            this.gridView1.SetNormalView(30);
            this.gridView1.RegistCustomDrawRowIndicator(40);
        }
        /// <summary>
@@ -32,27 +19,14 @@
        /// </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);
            this.xhsProjectSimulationHydroCheckFailedCtrl1.SetBindingData(allFailedList);
        }
        private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
        private void xhsProjectSimulationHydroCheckFailedCtrl1_HydroClickEvent(string obj)
        {
            var row = this.gridView1.GetRow(e.RowHandle) as XhsProjectSimulationHydroCheckFailedViewModel;
            if (row == null)
            {
                return;
            }
            this.HydroClickEvent?.Invoke(row.ParterId);
            this.HydroClickEvent?.Invoke(obj);
        }
    }
}