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 XhsProjectSimulationPumpUnMatchingListCtrl : DevExpress.XtraEditors.XtraUserControl
|
{
|
public XhsProjectSimulationPumpUnMatchingListCtrl()
|
{
|
InitializeComponent();
|
this.gridView1.SetNormalView(30);
|
this.gridView1.RegistCustomDrawRowIndicator(40);
|
}
|
|
/// <summary>
|
/// 显示查询面板
|
/// </summary>
|
[Browsable(true)]
|
[Description("显示查询面板")]
|
[DefaultValue(true)]
|
public bool ShowFindPanel
|
{
|
get { return this.gridView1.OptionsFind.AlwaysVisible; }
|
set { this.gridView1.OptionsFind.AlwaysVisible = value; }
|
}
|
|
/// <summary>
|
/// 水力点击事件
|
/// </summary>
|
public event Action<Yw.Model.HydroPumpInfo> HydroClickEvent;
|
|
private List<XhsProjectSimulationPumpUnMatchingViewModel> _allBindingList = null;//所有绑定列表
|
|
/// <summary>
|
/// 绑定数据
|
/// </summary>
|
/// <param name="allPumpList"></param>
|
public void SetBindingData(List<Yw.Model.HydroPumpInfo> allPumpList)
|
{
|
_allBindingList = new List<XhsProjectSimulationPumpUnMatchingViewModel>();
|
if (allPumpList != null && allPumpList.Count > 0)
|
{
|
foreach (var pump in allPumpList)
|
{
|
if (string.IsNullOrEmpty(pump.DbId))
|
{
|
var vm = new XhsProjectSimulationPumpUnMatchingViewModel(pump);
|
_allBindingList.Add(vm);
|
}
|
}
|
}
|
this.xhsProjectSimulationPumpUnMatchingViewModelBindingSource.DataSource = _allBindingList;
|
this.xhsProjectSimulationPumpUnMatchingViewModelBindingSource.ResetBindings(false);
|
}
|
|
//行点击事件
|
private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
|
{
|
var row = this.gridView1.GetRow(e.RowHandle) as XhsProjectSimulationPumpUnMatchingViewModel;
|
if (row == null)
|
{
|
return;
|
}
|
this.HydroClickEvent?.Invoke(row.Vmo);
|
}
|
|
}
|
}
|