using System.ComponentModel;
namespace HStation.WinFrmUI.Assets
{
public class AssetsValveMainViewModel
{
public AssetsValveMainViewModel(Vmo.AssetsValveMainVmo rhs)
{
this.ID = rhs.ID;
this.Name = rhs.Name;
this.Description = rhs.Description;
if (rhs.Caliber == null)
{
this.Caliber = "默认";
}
else
{
this.Caliber = rhs.Caliber.ToString();
}
if (rhs.MaterialName == null)
{
this.Material = "默认";
}
else
{
this.Material = rhs.MaterialName.ToString();
}
this.Coefficient = rhs.Coefficient;
this.SeriesID = rhs.SeriesID;
this.SeriesType = rhs.SeriesType;
this.SortCode = rhs.SortCode;
}
public void Reset(Vmo.AssetsValveMainVmo rhs)
{
this.ID = rhs.ID;
this.Name = rhs.Name;
this.Description = rhs.Description;
this.Material = rhs.MaterialName;
if (rhs.Caliber == null)
{
this.Caliber = "默认";
}
else
{
this.Caliber = rhs.Caliber.ToString();
}
if (rhs.MaterialName == null)
{
this.Material = "默认";
}
else
{
this.Material = rhs.MaterialName.ToString();
}
this.Coefficient = rhs.Coefficient;
this.SeriesID = rhs.SeriesID;
this.SeriesType = rhs.SeriesType;
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.eAssetsValveSeriesType SeriesType { 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; }
}
}