using Yw;
|
using Yw.Vmo;
|
|
namespace HStation.WinFrmUI
|
{
|
public partial class EditAssetsValveCurveDlg : DevExpress.XtraEditors.XtraForm
|
{
|
public EditAssetsValveCurveDlg()
|
{
|
InitializeComponent();
|
this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon;
|
this.layoutControl1.SetupLayoutControl();
|
this.generalOkAndCancelCtrl1.OkEvent += GeneralOkAndCancelCtrl1_OkEvent;
|
}
|
|
/// <summary>
|
///
|
/// </summary>
|
public event Action<PhartDiagramExGraphListVmo> ReloadDataEvent;
|
|
private PhartDiagramExGraphListVmo _vmo = null;
|
|
/// <summary>
|
/// 绑定数据
|
/// </summary>
|
public void SetBindingData(PhartDiagramExGraphListVmo vmo)
|
{
|
if (vmo == null)
|
{
|
return;
|
}
|
_vmo = vmo;
|
this.valveChartEditCtrl1.SetBindingData(vmo);
|
}
|
|
//确定
|
private async void GeneralOkAndCancelCtrl1_OkEvent()
|
{
|
if (_vmo == null)
|
{
|
return;
|
}
|
var diagram = this.valveChartEditCtrl1.Get();
|
var bol = await BLLFactory<Yw.BLL.PhartDiagramExtensions>.Instance.Update(diagram);
|
if (!bol)
|
{
|
TipFormHelper.ShowError("更新失败!");
|
return;
|
}
|
var vmo = await BLLFactory<Yw.BLL.PhartDiagramExtensions>.Instance.GetByID(diagram.ID);
|
this.ReloadDataEvent?.Invoke(vmo);
|
this.DialogResult = DialogResult.OK;
|
this.Close();
|
}
|
}
|
}
|