lixiaojun
2024-12-13 c4049242a1cc73da8210f381db72d1a807bd08d4
WinFrmUI/HStation.WinFrmUI.Assets.Core/22-cooling/02-main/AddAssetsCoolingMainDlg.cs
@@ -1,4 +1,7 @@
using DevExpress.XtraEditors;
using DevExpress.XtraScheduler.Outlook.Interop;
using HStation.Service.Assets;
using HStation.Vmo;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -22,6 +25,8 @@
            this.generalOkAndCancelCtrl1.OkEvent += GeneralOkAndCancelCtrl1_OkEvent;
        }
        private static AssetsCoolingMainVmo _last = null;
        /// <summary>
        /// 返回数据事件
        /// </summary>
@@ -44,6 +49,18 @@
            _vmo.SeriesID = series.ID;
            var flags = await BLLFactory<Yw.BLL.SysFlag>.Instance.GetBySysType(HStation.Assets.DataType.CoolingMain);
            this.setFlagsEditCtrl1.SetBindingData(flags?.Select(x => x.Name).ToList(), null);
            if (_last != null)
            {
                this.txtName.EditValue = _last.Name;
                this.txtMaterial.EditValue = _last.Material;
                this.txtKeyWord.EditValue = KeyWordHelper.ToString(_last.KeyWords);
                this.txtCaliber.EditValue = _last.Caliber;
                this.txtCoefficient.EditValue = _last.Coefficient;
                this.txtLowerLimit.EditValue = _last.LowerLimit;
                this.setFlagsEditCtrl1.SetBindingData(flags?.Select(x => x.Name).ToList(), _last.Flags);
                this.txtTagName.EditValue = _last.TagName;
                this.txtDescription.EditValue = _last.Description;
            }
        }
        //验证
@@ -114,6 +131,7 @@
                return;
            }
            var vmo = await BLLFactory<HStation.BLL.AssetsCoolingMain>.Instance.GetByID(id);
            _last = vmo;
            this.ReloadDataEvent?.Invoke(vmo);
            this.DialogResult = DialogResult.OK;
            this.Close();