namespace HStation.WinFrmUI
|
{
|
public partial class AssetsMeterSingleMatchingDlg : DevExpress.XtraEditors.XtraForm
|
{
|
public AssetsMeterSingleMatchingDlg()
|
{
|
InitializeComponent();
|
this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon;
|
this.generalOkAndCancelCtrl1.OkEvent += GeneralOkAndCancelCtrl1_OkEvent;
|
}
|
|
public event Action<HydroMeterMatchingViewModel> ReloadDataEvent;
|
|
private HydroMeterMatchingViewModel _input = null;
|
|
/// <summary>
|
///
|
/// </summary>
|
public void SetBindingData(HydroMeterMatchingViewModel input)
|
{
|
if (input == null)
|
{
|
return;
|
}
|
_input = input;
|
this.assetsMeterSingleMatchingCtrl2.SetBindingData(input.DbId);
|
}
|
|
private void GeneralOkAndCancelCtrl1_OkEvent()
|
{
|
if (_input == null)
|
{
|
return;
|
}
|
var vm = this.assetsMeterSingleMatchingCtrl2.Get();
|
if (vm == null)
|
{
|
return;
|
}
|
_input.MatchingDbId = vm.ID.ToString();
|
_input.MatchingModelType = vm.Name;
|
_input.MinorLoss = vm.MinorLoss;
|
this.ReloadDataEvent?.Invoke(_input);
|
this.DialogResult = DialogResult.OK;
|
this.Close();
|
}
|
}
|
}
|