namespace HStation.WinFrmUI { public partial class AssetsThreelinkSingleMatchingDlg : DevExpress.XtraEditors.XtraForm { public AssetsThreelinkSingleMatchingDlg() { InitializeComponent(); this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon; this.generalOkAndCancelCtrl1.OkEvent += GeneralOkAndCancelCtrl1_OkEvent; } public event Action ReloadDataEvent; private HydroThreelinkMatchingViewModel _input = null; /// /// /// public void SetBindingData(HydroThreelinkMatchingViewModel input) { if (input == null) { return; } _input = input; this.assetsThreelinkSingleMatchingCtrl1.SetBindingData(input.DbId); } private void GeneralOkAndCancelCtrl1_OkEvent() { if (_input == null) { return; } var vm = this.assetsThreelinkSingleMatchingCtrl1.Get(); if (vm == null) { return; } _input.MatchingDbId = vm.ID.ToString(); _input.MatchingModelType = vm.Name; _input.MatchingMaterial = vm.Material; _input.MatchingCaliber = vm.Caliber; _input.MatchingBranchThroughLoss = vm.BranchThroughMinorLoss; _input.MatchingRunningThroughLoss = vm.RunThroughMinorLoss; this.ReloadDataEvent?.Invoke(_input); this.DialogResult = DialogResult.OK; this.Close(); } } }