using Yw.Dto; namespace HStation.WinFrmUI.Basic { public class SysPropViewModel : Yw.Dto.SysPropDto { public SysPropViewModel(SysPropDto rhs) { ID = rhs.ID; GroupID = rhs.GroupID; TypeID = rhs.TypeID; Name = rhs.Name; Code = rhs.Code; if (rhs.Format == Yw.Basic.ePropFormat.Bigint) { this.FormatDisPlayName = "长整数"; } else if (rhs.Format == Yw.Basic.ePropFormat.Integer) { this.FormatDisPlayName = "整数"; } else if (rhs.Format == Yw.Basic.ePropFormat.MultiText) { this.FormatDisPlayName = "多文本"; } else if (rhs.Format == Yw.Basic.ePropFormat.Time) { this.FormatDisPlayName = "时间"; } else if (rhs.Format == Yw.Basic.ePropFormat.Numeric) { this.FormatDisPlayName = "数值"; } else if (rhs.Format == Yw.Basic.ePropFormat.Text) { this.FormatDisPlayName = "文本"; } else { this.FormatDisPlayName = "布尔"; } UnitName = rhs.UnitName; IsNull = rhs.IsNull; DefaultValue = rhs.DefaultValue; SortCode = rhs.SortCode; Description = rhs.Description; } public void Reset(UpdateSysPropInput rhs) { ID = rhs.ID; Name = rhs.Name; Code = rhs.Code; if (rhs.Format == Yw.Basic.ePropFormat.Bigint) { this.FormatDisPlayName = "长整数"; } else if (rhs.Format == Yw.Basic.ePropFormat.Integer) { this.FormatDisPlayName = "整数"; } else if (rhs.Format == Yw.Basic.ePropFormat.MultiText) { this.FormatDisPlayName = "多文本"; } else if (rhs.Format == Yw.Basic.ePropFormat.Time) { this.FormatDisPlayName = "时间"; } else if (rhs.Format == Yw.Basic.ePropFormat.Numeric) { this.FormatDisPlayName = "数值"; } else if (rhs.Format == Yw.Basic.ePropFormat.Text) { this.FormatDisPlayName = "文本"; } else { this.FormatDisPlayName = "布尔"; } UnitName = rhs.UnitName; IsNull = rhs.IsNull; DefaultValue = rhs.DefaultValue; Description = rhs.Description; } public string ExtendTypeDisPlayName { get; set; } public string FormatDisPlayName { get; set; } } }