duheng
2024-11-05 7c9869ecbc4380c17c1158b096dbb5b0a92ad439
WinFrmUI/HStation.WinFrmUI.Basic/02-SysPropManage/00-viewModel/SysPropViewModel.cs
@@ -2,16 +2,43 @@
namespace HStation.WinFrmUI.Basic
{
    public class SysPropViewModel : Yw.Dto.SysPropDto
    public class SysPropViewModel
    {
        public SysPropViewModel(SysPropDto rhs)
        public SysPropViewModel(Yw.Vmo.SysPropVmo rhs)
        {
            ID = rhs.ID;
            GroupID = rhs.GroupID;
            TypeID = rhs.TypeID;
            Name = rhs.Name;
            Code = rhs.Code;
            Format = rhs.Format;
            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;
@@ -19,12 +46,39 @@
            Description = rhs.Description;
        }
        public void Reset(UpdateSysPropInput rhs)
        public void Reset(Yw.Vmo.SysPropVmo rhs)
        {
            ID = rhs.ID;
            Name = rhs.Name;
            Code = rhs.Code;
            Format = rhs.Format;
            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;
@@ -32,5 +86,29 @@
        }
        public string ExtendTypeDisPlayName { get; set; }
        public string FormatDisPlayName { get; set; }
        public long ID { get; set; }
        public long GroupID { get; set; }
        public long TypeID { get; set; }
        public string Name { get; set; }
        public string Code { get; set; }
        public Yw.Basic.ePropFormat Format { get; set; }
        public string UnitName { get; set; }
        public bool IsNull { get; set; }
        public string DefaultValue { get; set; }
        public int SortCode { get; set; }
        public string Description { get; set; }
    }
}