namespace HStation.WinFrmUI { public partial class SimulationValveSingleMatchingDlg : DevExpress.XtraEditors.XtraForm { public SimulationValveSingleMatchingDlg() { InitializeComponent(); this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon; } public event Action ReloadDataEvent; private HydroValveMatchingViewModel _valveMatchingView = null; public void SetBindingData(HydroValveMatchingViewModel ValveMatchingViewModel) { this.xtraUserControl11.SetBindingData(ValveMatchingViewModel); _valveMatchingView = ValveMatchingViewModel; } //确定 private void btnComplete_Click(object sender, EventArgs e) { if (_valveMatchingView.MatchingDbId == null || _valveMatchingView.MatchingDbId == string.Empty) { TipFormHelper.ShowError("阀门型号选择错误"); return; } if ((int)_valveMatchingView.MatchingValveType == (int)HStation.Assets.eValveType.TCV || (int)_valveMatchingView.MatchingValveType == (int)HStation.Assets.eValveType.GPV) { if (_valveMatchingView.MatchingCurveDbId == null || _valveMatchingView.MatchingCurveDbId == string.Empty) { TipFormHelper.ShowError("曲线选择错误"); return; } } else { _valveMatchingView.MatchingCurveOL = null; _valveMatchingView.MatchingCurveQL = null; } ReloadDataEvent.Invoke(_valveMatchingView); this.Close(); } } }