lixiaojun
2024-12-30 c22cc4c60e9ff156fc25b39a5c024cc758df354b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
using Yw.Hydro;
 
namespace Yw.WinFrmUI
{
    /// <summary>
    /// 水力组件视图
    /// </summary>
    [TypeConverter(typeof(PropertySorter))]
    public class HydroParterViewModel
    {
        /// <summary>
        /// 
        /// </summary>
        public HydroParterViewModel() { }
 
        /// <summary>
        /// 
        /// </summary>
        public HydroParterViewModel
            (
                Yw.Model.HydroParterInfo rhs,
                Yw.Model.HydroModelInfo hydroInfo
            )
        {
            this.Code = rhs.Code;
            this.Name = rhs.Name;
            this.Catalog = HydroParterCatalogHelper.GetName(rhs.Catalog);
            this.ModelType = rhs.ModelType;
            this.DbId = rhs.DbId;
            this.DbLocked = rhs.DbLocked;
            this.Flags = Yw.Untity.FlagsHelper.ToString(rhs.Flags);
            this.Description = rhs.Description;
 
            this.Vmo = rhs;
            this.HydroInfo = hydroInfo;
        }
 
        /// <summary>
        /// 
        /// </summary>
        public HydroParterViewModel
            (
                Yw.Model.HydroParterInfo rhs,
                Yw.Model.HydroModelInfo hydroInfo,
                HydroParterPropStatusHelper propStatusHelper
            ) : this(rhs, hydroInfo)
        {
            this.PropStatusHelper = propStatusHelper;
        }
 
        /// <summary>
        /// 编码
        /// </summary>
        [Category("基础信息")]
        [DisplayName("编码")]
        [PropertyOrder(1)]
        [ReadOnly(true)]
        [Browsable(true)]
        public virtual string Code { get; set; }
 
        /// <summary>
        /// 名称
        /// </summary>
        [Category("基础信息")]
        [DisplayName("名称")]
        [PropertyOrder(2)]
        [Browsable(true)]
        public virtual string Name { get; set; }
 
        /// <summary>
        /// 分类
        /// </summary>
        [Category("基础信息")]
        [DisplayName("分类")]
        [PropertyOrder(3)]
        [ReadOnly(true)]
        [Browsable(true)]
        public virtual string Catalog { get; set; }
 
        /// <summary>
        /// 型号
        /// </summary>
        [Category("基础信息")]
        [DisplayName("型号")]
        [PropertyOrder(4)]
        [HydroModelTypePro]
        [Browsable(true)]
        public virtual string ModelType { get; set; }
 
        /// <summary>
        /// DbId
        /// </summary>
        [Browsable(false)]
        public virtual string DbId { get; set; }
 
        /// <summary>
        /// 匹配
        /// </summary>
        [Category("基础信息")]
        [DisplayName("匹配")]
        [PropertyOrder(5)]
        [ShowEditor(false)]
        [Browsable(true)]
        public virtual bool HasDb
        {
            get { return !string.IsNullOrEmpty(this.DbId); }
        }
 
        /// <summary>
        /// 标签
        /// </summary>
        [Category("基础信息")]
        [DisplayName("标签")]
        [PropertyOrder(6)]
        [HydroFlagsPro]
        [Browsable(true)]
        public virtual string Flags { get; set; }
 
        /// <summary>
        /// 说明
        /// </summary>
        [Category("基础信息")]
        [DisplayName("说明")]
        [PropertyOrder(7)]
        [MultiText]
        [Browsable(true)]
        public virtual string Description { get; set; }
 
        /// <summary>
        /// 锁定
        /// </summary>
        [Category("基础信息")]
        [DisplayName("锁定")]
        [PropertyOrder(8)]
        [Browsable(true)]
        public virtual bool DbLocked { get; set; }
 
        /// <summary>
        /// Vmo
        /// </summary>
        [Browsable(false)]
        public virtual Yw.Model.HydroParterInfo Vmo
        {
            get
            {
                return _vmo;
            }
            set
            {
                _vmo = value;
            }
        }
        protected Yw.Model.HydroParterInfo _vmo = null;
 
        /// <summary>
        /// HydroInfo
        /// </summary>
        [Browsable(false)]
        public virtual Yw.Model.HydroModelInfo HydroInfo { get; set; }
 
        /// <summary>
        /// PropStatusHelper
        /// </summary>
        [Browsable(false)]
        public virtual HydroParterPropStatusHelper PropStatusHelper { get; set; }
 
 
        /// <summary>
        /// 更新属性
        /// </summary>
        public virtual void UpdateProperty()
        {
            this.Code = this.Vmo.Code;
            this.Name = this.Vmo.Name;
            this.Catalog = HydroParterCatalogHelper.GetName(this.Vmo.Catalog);
            this.ModelType = this.Vmo.ModelType;
            this.DbId = this.Vmo.DbId;
            this.Flags = Yw.Untity.FlagsHelper.ToString(this.Vmo.Flags);
            this.Description = this.Vmo.Description;
            this.DbLocked = this.Vmo.DbLocked;
        }
 
        /// <summary>
        /// 更新Vmo属性
        /// </summary>
        public virtual void UpdateVmoProperty()
        {
            this.Vmo.Code = this.Code;
            this.Vmo.Name = this.Name;
            this.Vmo.Catalog = HydroParterCatalogHelper.GetCode(this.Catalog);
            this.Vmo.ModelType = this.ModelType;
            this.Vmo.DbId = this.DbId;
            this.Vmo.DbLocked = this.DbLocked;
            this.Vmo.Flags = Yw.Untity.FlagsHelper.ToList(this.Flags);
            this.Vmo.Description = this.Description;
        }
 
        /// <summary>
        /// 更新属性状态
        /// </summary>
        public virtual void UpdatePropStatus(string propName, ePropStatus propStatus, string statusInfo)
        {
            this.PropStatusHelper?.UpdatePropStatus(this.Vmo, propName, propStatus, statusInfo);
        }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
    }
}