lixiaojun
2024-12-30 c22cc4c60e9ff156fc25b39a5c024cc758df354b
WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/01-parter/HydroParterViewModel.cs
@@ -1,4 +1,6 @@
namespace Yw.WinFrmUI
using Yw.Hydro;
namespace Yw.WinFrmUI
{
    /// <summary>
    /// 水力组件视图
@@ -14,19 +16,36 @@
        /// <summary>
        /// 
        /// </summary>
        public HydroParterViewModel(Yw.Model.HydroParterInfo rhs, Yw.Model.HydroModelInfo hydroInfo)
        public HydroParterViewModel
            (
                Yw.Model.HydroParterInfo rhs,
                Yw.Model.HydroModelInfo hydroInfo
            )
        {
            this.Code = rhs.Code;
            this.Name = rhs.Name;
            this.Catalog = HydroParterCatalogHelper.GetName(rhs.Catalog);
            this.ModelType = rhs.ModelType;
            this.DbId = rhs.DbId;
            this.DbLocked = rhs.DbLocked;
            this.Flags = Yw.Untity.FlagsHelper.ToString(rhs.Flags);
            this.Description = rhs.Description;
            this.DbLocked = rhs.DbLocked;
            this.Vmo = rhs;
            this.HydroInfo = hydroInfo;
        }
        /// <summary>
        ///
        /// </summary>
        public HydroParterViewModel
            (
                Yw.Model.HydroParterInfo rhs,
                Yw.Model.HydroModelInfo hydroInfo,
                HydroParterPropStatusHelper propStatusHelper
            ) : this(rhs, hydroInfo)
        {
            this.PropStatusHelper = propStatusHelper;
        }
        /// <summary>
@@ -139,6 +158,12 @@
        [Browsable(false)]
        public virtual Yw.Model.HydroModelInfo HydroInfo { get; set; }
        /// <summary>
        /// PropStatusHelper
        /// </summary>
        [Browsable(false)]
        public virtual HydroParterPropStatusHelper PropStatusHelper { get; set; }
        /// <summary>
        /// 更新属性
@@ -170,6 +195,13 @@
            this.Vmo.Description = this.Description;
        }
        /// <summary>
        /// 更新属性状态
        /// </summary>
        public virtual void UpdatePropStatus(string propName, ePropStatus propStatus, string statusInfo)
        {
            this.PropStatusHelper?.UpdatePropStatus(this.Vmo, propName, propStatus, statusInfo);
        }