using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; namespace IStation.Model { /// /// 监测记录基础内容 /// public class MonitorBasicRecordContent { /// /// /// public MonitorBasicRecordContent() { } /// /// /// public MonitorBasicRecordContent(MonitorBasicRecordContent rhs) { this.SrcTime = rhs.SrcTime; this.DataTime = rhs.DataTime; this.SrcValue = rhs.SrcValue; this.DataValue = rhs.DataValue; this.DataStatus = rhs.DataStatus; } /// /// 原始时间 /// public DateTime SrcTime { get; set; } /// /// 原始值 /// public string SrcValue { get; set; } /// /// 数据时间 /// public DateTime DataTime { get; set; } /// /// 数据值 /// public string DataValue { get; set; } /// /// 数据状态 /// public List DataStatus { get; set; } /// /// 获取数据值 /// public bool GetDataValue(int roundNum , out double value) { value =0; if (string.IsNullOrEmpty(DataValue)) return false; if(double.TryParse(DataValue, out value)) { return true; } else { if (roundNum >= 0) value = Math.Round(value, roundNum); return true; } } } }