namespace Yw.WinFrmUI { /// /// /// public class HydroCheckItemViewModel { /// /// /// public HydroCheckItemViewModel() { } /// /// /// public HydroCheckItemViewModel(HydroCheckItem rhs) { this.Succeed = !rhs.Failed; switch (rhs.Mode) { case HydroCheckMode.Global: this.Mode = "整体"; break; case HydroCheckMode.Item: this.Mode = "构件"; break; default: break; } switch (rhs.Type) { case HydroCheckType.LackSource: this.Type = "缺少水源"; break; case HydroCheckType.LackJunction: this.Type = "缺少连接节点"; break; case HydroCheckType.LackPump: this.Type = "缺少水泵"; break; case HydroCheckType.AloneNode: this.Type = "孤立节点"; break; case HydroCheckType.AbnormalLink: this.Type = "管段异常连接"; break; case HydroCheckType.AbnormalProp: this.Type = "属性异常"; break; default: break; } this.Code = rhs.Code; this.Reason = rhs.Reason; this.SortCode = rhs.Failed ? 1 : 2; } /// /// 成功 /// [DisplayName("成功")] public bool Succeed { get; set; } /// /// 检查模式 /// [DisplayName("检查模式")] public string Mode { get; set; } /// /// 检查类型 /// [DisplayName("检查类型")] public string Type { get; set; } /// /// 检查编码 /// [DisplayName("检查编码")] public string Code { get; set; } /// /// 检查原因 /// [DisplayName("检查原因")] public string Reason { get; set; } /// /// 排序码 /// [DisplayName("排序码")] [Browsable(false)] public int SortCode { get; set; } } }