using DevExpress.Mvvm.POCO;
|
using DevExpress.XtraEditors;
|
using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Data;
|
using System.Drawing;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using System.Windows.Forms;
|
|
namespace HStation.WinFrmUI
|
{
|
public partial class AssetsExchangerSingleMatchingDlg : DevExpress.XtraEditors.XtraForm
|
{
|
public AssetsExchangerSingleMatchingDlg()
|
{
|
InitializeComponent();
|
this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon;
|
this.generalOkAndCancelCtrl1.OkEvent += GeneralOkAndCancelCtrl1_OkEvent;
|
}
|
|
public event Action<HydroExchangerMatchingViewModel> ReloadDataEvent;
|
|
private HydroExchangerMatchingViewModel _input = null;
|
|
/// <summary>
|
///
|
/// </summary>
|
public void SetBindingData(HydroExchangerMatchingViewModel input)
|
{
|
if (input == null)
|
{
|
return;
|
}
|
_input = input;
|
this.assetsExchangerSingleMatchingCtrl1.SetBindingData(input.DbId, input.CurveDbId);
|
}
|
|
private void GeneralOkAndCancelCtrl1_OkEvent()
|
{
|
if (_input == null)
|
{
|
return;
|
}
|
var vm = this.assetsExchangerSingleMatchingCtrl1.Get();
|
if (vm == null)
|
{
|
return;
|
}
|
|
_input.MatchingModelType = vm.Vmo.Name;
|
_input.MatchingMaterial = vm.Vmo.Material;
|
_input.MatchingDiameter = vm.Vmo.Diameter;
|
_input.MatchingMinorLoss = vm.Vmo.MinorLoss;
|
_input.MatchingCurveQL = vm.MatchingCurve;
|
_input.MatchingDbId = vm.Vmo.ID.ToString();
|
_input.MatchingCurveDbId = vm.MatchingCurveDbId;
|
this.ReloadDataEvent?.Invoke(_input);
|
this.DialogResult = DialogResult.OK;
|
this.Close();
|
}
|
}
|
}
|