| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public HydroParterViewModel() |
| | | { |
| | | this.PropStatusList = new List<HydroParterPropStatusViewModel>(); |
| | | } |
| | | public HydroParterViewModel() { } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public HydroParterViewModel(Yw.Model.HydroParterInfo rhs, Yw.Model.HydroModelInfo hydroInfo) : this() |
| | | public HydroParterViewModel |
| | | ( |
| | | Yw.Model.HydroParterInfo rhs, |
| | | Yw.Model.HydroModelInfo hydroInfo |
| | | ) |
| | | { |
| | | this.ID = rhs.ID; |
| | | this.UpdatePropStatus(nameof(this.ID), rhs, nameof(rhs.ID)); |
| | | this.Catalog = HydroParterCatalogHelper.GetCatalogName(rhs.Catalog); |
| | | this.UpdatePropStatus(nameof(this.Catalog), rhs, nameof(rhs.Catalog)); |
| | | this.Name = rhs.Name; |
| | | this.UpdatePropStatus(nameof(this.Name), rhs, nameof(rhs.Name)); |
| | | this.Code = rhs.Code; |
| | | this.UpdatePropStatus(nameof(this.Code), rhs, nameof(rhs.Code)); |
| | | this.Name = rhs.Name; |
| | | this.Catalog = HydroParterCatalogHelper.GetName(rhs.Catalog); |
| | | this.ModelType = rhs.ModelType; |
| | | this.UpdatePropStatus(nameof(this.ModelType), rhs, nameof(rhs.ModelType)); |
| | | this.DbId = rhs.DbId; |
| | | this.UpdatePropStatus(nameof(this.DbId), rhs, nameof(rhs.DbId)); |
| | | this.Flags = Yw.Untity.FlagsHelper.ToString(rhs.Flags); |
| | | this.UpdatePropStatus(nameof(this.Flags), rhs, nameof(rhs.Flags)); |
| | | this.Description = rhs.Description; |
| | | this.UpdatePropStatus(nameof(this.Description), rhs, nameof(rhs.Description)); |
| | | this.DbLocked = rhs.DbLocked; |
| | | this.UpdatePropStatus(nameof(this.DbLocked), rhs, nameof(rhs.DbLocked)); |
| | | |
| | | this.BeginGroup = rhs.BeginGroup; |
| | | this.Flags = Yw.Untity.FlagsHelper.ToString(rhs.Flags); |
| | | this.Description = rhs.Description; |
| | | this.Paras = new DictionaryPropertyAdapter(rhs.Paras); |
| | | this.Vmo = rhs; |
| | | this.HydroInfo = hydroInfo; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// ID |
| | | /// </summary> |
| | | [Browsable(false)] |
| | | public virtual long ID { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 分类 |
| | | /// 编码 |
| | | /// </summary> |
| | | [Category("基础信息")] |
| | | [DisplayName("分类")] |
| | | [DisplayName("编码")] |
| | | [PropertyOrder(1)] |
| | | [ReadOnly(true)] |
| | | [Browsable(true)] |
| | | public virtual string Catalog { get; set; } |
| | | public virtual string Code { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 名称 |
| | |
| | | public virtual string Name { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 编码 |
| | | /// 分类 |
| | | /// </summary> |
| | | [Category("基础信息")] |
| | | [DisplayName("编码")] |
| | | [DisplayName("分类")] |
| | | [PropertyOrder(3)] |
| | | [ReadOnly(true)] |
| | | [Browsable(true)] |
| | | public virtual string Code { get; set; } |
| | | public virtual string Catalog { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 型号 |
| | |
| | | [Category("基础信息")] |
| | | [DisplayName("型号")] |
| | | [PropertyOrder(4)] |
| | | [IsHydroModelType] |
| | | [HydroModelTypePro] |
| | | [Browsable(true)] |
| | | public virtual string ModelType { get; set; } |
| | | |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 分组 |
| | | /// </summary> |
| | | [Category("基础信息")] |
| | | [DisplayName("分组")] |
| | | [PropertyOrder(6)] |
| | | [Browsable(true)] |
| | | public virtual string BeginGroup { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 标签 |
| | | /// </summary> |
| | | [Category("基础信息")] |
| | | [DisplayName("标签")] |
| | | [PropertyOrder(6)] |
| | | [IsHydroFlagsPro(true)] |
| | | [PropertyOrder(7)] |
| | | [HydroFlagsPro] |
| | | [Browsable(true)] |
| | | public virtual string Flags { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 参数 |
| | | /// </summary> |
| | | [Category("基础信息")] |
| | | [DisplayName("参数")] |
| | | [HydroParasPro] |
| | | [PropertyOrder(8)] |
| | | [Browsable(true)] |
| | | public virtual DictionaryPropertyAdapter Paras { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 说明 |
| | | /// </summary> |
| | | [Category("基础信息")] |
| | | [DisplayName("说明")] |
| | | [PropertyOrder(7)] |
| | | [PropertyOrder(9)] |
| | | [MultiText] |
| | | [Browsable(true)] |
| | | public virtual string Description { get; set; } |
| | |
| | | /// </summary> |
| | | [Category("基础信息")] |
| | | [DisplayName("锁定")] |
| | | [PropertyOrder(8)] |
| | | [PropertyOrder(10)] |
| | | [Browsable(true)] |
| | | public virtual bool DbLocked { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 属性状态列表 |
| | | /// </summary> |
| | | [Browsable(false)] |
| | | public virtual List<HydroParterPropStatusViewModel> PropStatusList { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Vmo |
| | | /// </summary> |
| | | [Browsable(false)] |
| | | public virtual Yw.Model.HydroParterInfo Vmo { get; set; } |
| | | public virtual Yw.Model.HydroParterInfo Vmo |
| | | { |
| | | get |
| | | { |
| | | return _vmo; |
| | | } |
| | | set |
| | | { |
| | | _vmo = value; |
| | | } |
| | | } |
| | | protected Yw.Model.HydroParterInfo _vmo = null; |
| | | |
| | | /// <summary> |
| | | /// HydroInfo |
| | |
| | | public virtual Yw.Model.HydroModelInfo HydroInfo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// PropStatusHelper |
| | | /// </summary> |
| | | [Browsable(false)] |
| | | public virtual HydroPropStatusHelper PropStatusHelper { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 更新属性 |
| | | /// </summary> |
| | | public virtual void UpdateProperty() |
| | | { |
| | | this.ID = this.Vmo.ID; |
| | | this.UpdatePropStatus(nameof(this.ID), this.Vmo, nameof(this.Vmo.ID)); |
| | | this.Catalog = HydroParterCatalogHelper.GetCatalogName(this.Vmo.Catalog); |
| | | this.UpdatePropStatus(nameof(this.Catalog), this.Vmo, nameof(this.Vmo.Catalog)); |
| | | this.Name = this.Vmo.Name; |
| | | this.UpdatePropStatus(nameof(this.Name), this.Vmo, nameof(this.Vmo.Name)); |
| | | this.Code = this.Vmo.Code; |
| | | this.UpdatePropStatus(nameof(this.Code), this.Vmo, nameof(this.Vmo.Code)); |
| | | this.Name = this.Vmo.Name; |
| | | this.Catalog = HydroParterCatalogHelper.GetName(this.Vmo.Catalog); |
| | | this.ModelType = this.Vmo.ModelType; |
| | | this.UpdatePropStatus(nameof(this.ModelType), this.Vmo, nameof(this.Vmo.ModelType)); |
| | | this.DbId = this.Vmo.DbId; |
| | | this.UpdatePropStatus(nameof(this.DbId), this.Vmo, nameof(this.Vmo.DbId)); |
| | | this.BeginGroup = this.Vmo.BeginGroup; |
| | | this.Flags = Yw.Untity.FlagsHelper.ToString(this.Vmo.Flags); |
| | | this.UpdatePropStatus(nameof(this.Flags), this.Vmo, nameof(this.Vmo.Flags)); |
| | | this.Paras = new DictionaryPropertyAdapter(this.Vmo.Paras); |
| | | this.Description = this.Vmo.Description; |
| | | this.UpdatePropStatus(nameof(this.Description), this.Vmo, nameof(this.Vmo.Description)); |
| | | this.DbLocked = this.Vmo.DbLocked; |
| | | this.UpdatePropStatus(nameof(this.DbLocked), this.Vmo, nameof(this.Vmo.DbLocked)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新计算属性 |
| | | /// 更新Vmo属性 |
| | | /// </summary> |
| | | public virtual void UpdateCalcuProperty(HydroCalcuResult rhs) |
| | | 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.BeginGroup = this.BeginGroup; |
| | | this.Vmo.Flags = Yw.Untity.FlagsHelper.ToList(this.Flags); |
| | | this.Vmo.Paras = (Dictionary<string, string>)this.Paras?.Dictionary; |
| | | this.Vmo.Description = this.Description; |
| | | } |
| | | |
| | | |