using Yw.Hydro;
|
|
namespace Yw.WinFrmUI
|
{
|
/// <summary>
|
/// 水力组件视图
|
/// </summary>
|
[TypeConverter(typeof(PropertySorter))]
|
public class HydroParterViewModel
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public HydroParterViewModel() { }
|
|
/// <summary>
|
///
|
/// </summary>
|
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.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>
|
/// 编码
|
/// </summary>
|
[Category("基础信息")]
|
[DisplayName("编码")]
|
[PropertyOrder(1)]
|
[ReadOnly(true)]
|
[Browsable(true)]
|
public virtual string Code { get; set; }
|
|
/// <summary>
|
/// 名称
|
/// </summary>
|
[Category("基础信息")]
|
[DisplayName("名称")]
|
[PropertyOrder(2)]
|
[Browsable(true)]
|
public virtual string Name { get; set; }
|
|
/// <summary>
|
/// 分类
|
/// </summary>
|
[Category("基础信息")]
|
[DisplayName("分类")]
|
[PropertyOrder(3)]
|
[ReadOnly(true)]
|
[Browsable(true)]
|
public virtual string Catalog { get; set; }
|
|
/// <summary>
|
/// 型号
|
/// </summary>
|
[Category("基础信息")]
|
[DisplayName("型号")]
|
[PropertyOrder(4)]
|
[HydroModelTypePro]
|
[Browsable(true)]
|
public virtual string ModelType { get; set; }
|
|
/// <summary>
|
/// DbId
|
/// </summary>
|
[Browsable(false)]
|
public virtual string DbId { get; set; }
|
|
/// <summary>
|
/// 匹配
|
/// </summary>
|
[Category("基础信息")]
|
[DisplayName("匹配")]
|
[PropertyOrder(5)]
|
[ShowEditor(false)]
|
[Browsable(true)]
|
public virtual bool HasDb
|
{
|
get { return !string.IsNullOrEmpty(this.DbId); }
|
}
|
|
/// <summary>
|
/// 标签
|
/// </summary>
|
[Category("基础信息")]
|
[DisplayName("标签")]
|
[PropertyOrder(6)]
|
[HydroFlagsPro]
|
[Browsable(true)]
|
public virtual string Flags { get; set; }
|
|
/// <summary>
|
/// 说明
|
/// </summary>
|
[Category("基础信息")]
|
[DisplayName("说明")]
|
[PropertyOrder(7)]
|
[MultiText]
|
[Browsable(true)]
|
public virtual string Description { get; set; }
|
|
/// <summary>
|
/// 锁定
|
/// </summary>
|
[Category("基础信息")]
|
[DisplayName("锁定")]
|
[PropertyOrder(8)]
|
[Browsable(true)]
|
public virtual bool DbLocked { get; set; }
|
|
/// <summary>
|
/// Vmo
|
/// </summary>
|
[Browsable(false)]
|
public virtual Yw.Model.HydroParterInfo Vmo
|
{
|
get
|
{
|
return _vmo;
|
}
|
set
|
{
|
_vmo = value;
|
}
|
}
|
protected Yw.Model.HydroParterInfo _vmo = null;
|
|
/// <summary>
|
/// HydroInfo
|
/// </summary>
|
[Browsable(false)]
|
public virtual Yw.Model.HydroModelInfo HydroInfo { get; set; }
|
|
/// <summary>
|
/// PropStatusHelper
|
/// </summary>
|
[Browsable(false)]
|
public virtual HydroParterPropStatusHelper PropStatusHelper { get; set; }
|
|
|
/// <summary>
|
/// 更新属性
|
/// </summary>
|
public virtual void UpdateProperty()
|
{
|
this.Code = this.Vmo.Code;
|
this.Name = this.Vmo.Name;
|
this.Catalog = HydroParterCatalogHelper.GetName(this.Vmo.Catalog);
|
this.ModelType = this.Vmo.ModelType;
|
this.DbId = this.Vmo.DbId;
|
this.Flags = Yw.Untity.FlagsHelper.ToString(this.Vmo.Flags);
|
this.Description = this.Vmo.Description;
|
this.DbLocked = this.Vmo.DbLocked;
|
}
|
|
/// <summary>
|
/// 更新Vmo属性
|
/// </summary>
|
public virtual void UpdateVmoProperty()
|
{
|
this.Vmo.Code = this.Code;
|
this.Vmo.Name = this.Name;
|
this.Vmo.Catalog = HydroParterCatalogHelper.GetCode(this.Catalog);
|
this.Vmo.ModelType = this.ModelType;
|
this.Vmo.DbId = this.DbId;
|
this.Vmo.DbLocked = this.DbLocked;
|
this.Vmo.Flags = Yw.Untity.FlagsHelper.ToList(this.Flags);
|
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);
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
}
|