using System.ComponentModel; namespace HStation.WinFrmUI.Assets { public class ValveMainViewModel { public ValveMainViewModel(Vmo.ValveMainVmo rhs) { this.ID = rhs.ID; this.Name = rhs.Name; this.CreateTime = rhs.CreateTime; this.CreateName = rhs.CreateName; this.Description = rhs.Description; this.Material = rhs.Material; if (rhs.Caliber == null) { this.Caliber = "默认"; } else { this.Caliber = rhs.Caliber.ToString(); } this.Coefficient = rhs.Coefficient; this.SeriesID = rhs.SeriesID; this.Type = rhs.Type; this.SortCode = rhs.SortCode; } public void Reset(Vmo.ValveMainVmo rhs) { this.ID = rhs.ID; this.Name = rhs.Name; this.CreateTime = rhs.CreateTime; this.CreateName = rhs.CreateName; this.Description = rhs.Description; this.Material = rhs.Material; if (rhs.Caliber == null) { this.Caliber = "默认"; } else { this.Caliber = rhs.Caliber.ToString(); } this.Coefficient = rhs.Coefficient; this.SeriesID = rhs.SeriesID; this.Type = rhs.Type; this.SortCode = rhs.SortCode; } [DisplayName("ID")] [Browsable(false)] public long ID { get; set; } /// /// 系列ID /// [DisplayName("系列ID")] [Browsable(false)] public long SeriesID { get; set; } /// /// 口径 /// [DisplayName("口径(mm)")] [Browsable(true)] public string Caliber { get; set; } /// /// 材料 /// [DisplayName("材料")] [Browsable(true)] public string Material { get; set; } /// /// 损失系数 /// [DisplayName("损失系数")] [Browsable(true)] public double Coefficient { get; set; } /// /// 类型 /// [DisplayName("类型")] [Browsable(true)] public HStation.Assets.eValveSeriesType Type { get; set; } /// /// 说明 /// [DisplayName("说明")] [Browsable(true)] public string? Description { get; set; } /// /// 排序码 /// [DisplayName("排序码")] [Browsable(true)] public int SortCode { get; set; } /// /// 名称 /// [DisplayName("型号")] [Browsable(true)] public string Name { get; set; } /// /// 创建人 /// [DisplayName("创建人")] [Browsable(true)] public string CreateName { get; set; } /// /// 创建时间 /// [DisplayName("创建时间")] [Browsable(true)] public string CreateTime { get; set; } } }