namespace HStation.WinFrmUI
|
{
|
public partial class AssetsValveSingleMatchingDlg : DevExpress.XtraEditors.XtraForm
|
{
|
public AssetsValveSingleMatchingDlg()
|
{
|
InitializeComponent();
|
this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon;
|
this.generalOkAndCancelCtrl1.OkEvent += GeneralOkAndCancelCtrl1_OkEvent;
|
}
|
|
public event Action<HydroValveMatchingViewModel> ReloadDataEvent;
|
|
private HydroValveMatchingViewModel _input = null;
|
|
/// <summary>
|
///
|
/// </summary>
|
public void SetBindingData(HydroValveMatchingViewModel input)
|
{
|
if (input == null)
|
{
|
return;
|
}
|
_input = input;
|
this.assetsValveSingleMatchingCtrl2.SetBindingData(input.DbId, input.CurveDbId);
|
}
|
|
private void GeneralOkAndCancelCtrl1_OkEvent()
|
{
|
if (_input == null)
|
{
|
return;
|
}
|
var vm = this.assetsValveSingleMatchingCtrl2.Get();
|
if (vm == null)
|
{
|
return;
|
}
|
_input.MatchingDbId = vm.Vmo.ID.ToString();
|
_input.MatchingModelType = vm.Vmo.Name;
|
_input.MatchingMaterial = vm.Vmo.Material;
|
_input.MatchingDiameter = vm.Vmo.Caliber;
|
_input.MatchingMinorLoss = vm.Vmo.MinorLoss;
|
_input.MatchingCurveOL = vm.MatchingCurveOL;
|
_input.MatchingCurveQL = vm.MatchingCurveQL;
|
_input.MatchingCurveDbId = vm.MatchingCurveDbId;
|
this.ReloadDataEvent?.Invoke(_input);
|
this.DialogResult = DialogResult.OK;
|
this.Close();
|
}
|
}
|
}
|