namespace Yw.WinFrmUI { /// /// 水力组件属性视图 /// [TypeConverter(typeof(PropertySorter))] public class HydroParterPropertyViewModel { /// /// /// public HydroParterPropertyViewModel() { this.PropStatusList = new List(); } /// /// /// public HydroParterPropertyViewModel(Yw.Model.HydroParterInfo rhs) : this() { this.ID = rhs.ID; this.Catalog = HydroParterCatalogHelper.GetCatalogName(rhs.Catalog); this.Name = rhs.Name; this.Code = rhs.Code; this.ModelType = rhs.ModelType; this.DbId = rhs.DbId; this.HasDb = !string.IsNullOrEmpty(rhs.DbId); this.Flags = Yw.Untity.FlagsHelper.ToString(rhs.Flags); this.Description = rhs.Description; this.DbLocked = rhs.DbLocked; } /// /// ID /// [Browsable(false)] public virtual long ID { get; set; } /// /// 分类 /// [Category("基础信息")] [DisplayName("分类")] [PropertyOrder(1)] [Browsable(true)] [ReadOnly(true)] public virtual string Catalog { get; set; } /// /// 名称 /// [Category("基础信息")] [DisplayName("名称")] [PropertyOrder(2)] [Browsable(true)] public virtual string Name { get; set; } /// /// 编码 /// [Category("基础信息")] [DisplayName("编码")] [PropertyOrder(3)] [Browsable(true)] [ReadOnly(true)] public virtual string Code { get; set; } /// /// 型号 /// [Category("基础信息")] [DisplayName("型号")] [PropertyOrder(4)] [IsHydroModelType] [Browsable(true)] public virtual string ModelType { get; set; } /// /// DbId /// [Browsable(false)] public virtual string DbId { get; set; } /// /// 匹配 /// [Category("基础信息")] [DisplayName("匹配")] [PropertyOrder(5)] [ReadOnly(true)] public virtual bool HasDb { get; set; } /// /// 标签 /// [Category("基础信息")] [DisplayName("标签")] [PropertyOrder(6)] [IsHydroFlagsPro(true)] [Browsable(true)] public virtual string Flags { get; set; } /// /// 说明 /// [Category("基础信息")] [DisplayName("说明")] [PropertyOrder(7)] [MultiText] [Browsable(true)] public virtual string Description { get; set; } /// /// 锁定 /// [Category("基础信息")] [DisplayName("锁定")] [PropertyOrder(8)] [Browsable(true)] public virtual bool DbLocked { get; set; } /// /// 属性状态列表 /// [Browsable(false)] public virtual List PropStatusList { get; set; } /// /// 更新属性 /// /// 当前组件 /// 所有组件列表 public virtual void UpdateProperty(Yw.Model.HydroParterInfo rhs, List allParterList) { this.ID = rhs.ID; this.Catalog = HydroParterCatalogHelper.GetCatalogName(rhs.Catalog); this.Name = rhs.Name; this.Code = rhs.Code; this.ModelType = rhs.ModelType; this.DbId = rhs.DbId; this.HasDb = !string.IsNullOrEmpty(rhs.DbId); this.Flags = Yw.Untity.FlagsHelper.ToString(rhs.Flags); this.Description = rhs.Description; this.DbLocked = rhs.DbLocked; } /// /// 更新计算属性 /// /// 计算属性 public virtual void UpdateCalcuProperty(IHydroCalcuResult rhs) { } } }