| | |
| | | /// <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.GetName(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.Flags = Yw.Untity.FlagsHelper.ToString(rhs.Flags); |
| | | this.Description = rhs.Description; |
| | | |
| | | 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> |
| | | /// 型号 |
| | |
| | | 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> |
| | | public HydroParterPropStatusViewModel GetPropStatus(string propName) |
| | | { |
| | | if (this.PropStatusList == null) |
| | | { |
| | | return default; |
| | | } |
| | | var propStatus = this.PropStatusList.Find(x => x.PropName == propName); |
| | | return propStatus; |
| | | } |
| | | [Browsable(false)] |
| | | public virtual HydroPropStatusHelper PropStatusHelper { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 更新属性状态 |
| | | /// </summary> |
| | | public bool UpdatePropStatus(string propName, Yw.Hydro.ePropStatus propStatus, string statusInfo) |
| | | { |
| | | if (string.IsNullOrEmpty(propName)) |
| | | { |
| | | return false; |
| | | } |
| | | if (this.PropStatusList == null) |
| | | { |
| | | this.PropStatusList = new List<HydroParterPropStatusViewModel>(); |
| | | } |
| | | var propStatusViewModel = GetPropStatus(propName); |
| | | if (propStatusViewModel == null) |
| | | { |
| | | propStatusViewModel = new HydroParterPropStatusViewModel() { PropName = propName }; |
| | | this.PropStatusList.Add(propStatusViewModel); |
| | | } |
| | | propStatusViewModel.PropStatus = propStatus; |
| | | propStatusViewModel.StatusInfo = statusInfo; |
| | | return true; |
| | | } |
| | | |
| | | /// <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.GetName(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.Flags = Yw.Untity.FlagsHelper.ToString(this.Vmo.Flags); |
| | | this.UpdatePropStatus(nameof(this.Flags), this.Vmo, nameof(this.Vmo.Flags)); |
| | | 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> |
| | | /// 更新计算属性 |
| | | /// </summary> |
| | | public virtual void UpdateCalcuProperty(HydroCalcuVisualResult rhs) |
| | | { |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public virtual void UpdateVmoProperty() |
| | | { |
| | | this.Vmo.ID = this.ID; |
| | | this.Vmo.UpdatePropStatus(nameof(this.Vmo.ID), this, nameof(this.ID)); |
| | | this.Vmo.Catalog = HydroParterCatalogHelper.GetCode(this.Catalog); |
| | | this.Vmo.UpdatePropStatus(nameof(this.Vmo.Catalog), this, nameof(this.Catalog)); |
| | | this.Vmo.Name = this.Name; |
| | | this.Vmo.UpdatePropStatus(nameof(this.Vmo.Name), this, nameof(this.Name)); |
| | | this.Vmo.Code = this.Code; |
| | | this.Vmo.UpdatePropStatus(nameof(this.Vmo.Code), this, nameof(this.Code)); |
| | | this.Vmo.Name = this.Name; |
| | | this.Vmo.Catalog = HydroParterCatalogHelper.GetCode(this.Catalog); |
| | | this.Vmo.ModelType = this.ModelType; |
| | | this.Vmo.UpdatePropStatus(nameof(this.Vmo.ModelType), this, nameof(this.ModelType)); |
| | | this.Vmo.DbId = this.DbId; |
| | | this.Vmo.UpdatePropStatus(nameof(this.Vmo.DbId), this, nameof(this.DbId)); |
| | | this.Vmo.DbLocked = this.DbLocked; |
| | | this.Vmo.UpdatePropStatus(nameof(this.Vmo.DbLocked), this, nameof(this.DbLocked)); |
| | | this.Vmo.Flags = Yw.Untity.FlagsHelper.ToList(this.Flags); |
| | | this.Vmo.UpdatePropStatus(nameof(this.Vmo.Flags), this, nameof(this.Flags)); |
| | | this.Vmo.Description = this.Description; |
| | | this.Vmo.UpdatePropStatus(nameof(this.Vmo.Description), this, nameof(this.Description)); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |