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; } /// /// /// public event Action ReloadDataEvent; private PhartDiagramExGraphListVmo _vmo = null; /// /// 绑定数据 /// 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.Instance.Update(diagram); if (!bol) { TipFormHelper.ShowError("更新失败!"); return; } var vmo = await BLLFactory.Instance.GetByID(diagram.ID); this.ReloadDataEvent?.Invoke(vmo); this.DialogResult = DialogResult.OK; this.Close(); } } }