namespace HStation.WinFrmUI { public partial class AssetsTankSingleMatchingDlg : DevExpress.XtraEditors.XtraForm { public AssetsTankSingleMatchingDlg() { InitializeComponent(); this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon; this.generalOkAndCancelCtrl1.OkEvent += GeneralOkAndCancelCtrl1_OkEvent; } public event Action ReloadDataEvent; private HydroTankMatchingViewModel _input = null; /// /// /// public void SetBindingData(HydroTankMatchingViewModel input) { if (input == null) { return; } _input = input; this.assetsTankSingleMatchingCtrl1.SetBindingData(input.DbId, input.CurveDbId); } private void GeneralOkAndCancelCtrl1_OkEvent() { if (_input == null) { return; } var vm = this.assetsTankSingleMatchingCtrl1.Get(); if (vm == null) { return; } _input.MatchingModelType = vm.Vmo.Name; _input.MatchingCurveDbId = vm.MatchingCurveDbId; _input.MatchingMaxLevel = vm.Vmo.MaxLevel; _input.MatchingMinLevel = vm.Vmo.MinLevel; _input.MatchingMinVol = vm.Vmo.MinVol; _input.MatchingOverFlow = vm.Vmo.OverFlow; _input.MatchingDN = vm.Vmo.DN; _input.MatchingDbId = vm.Vmo.ID.ToString(); _input.MatchingVolCurve = vm.MatchingCurve; this.ReloadDataEvent?.Invoke(_input); this.DialogResult = DialogResult.OK; this.Close(); } } }