namespace IStation.Dto
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public class QueryEtaAnalyRunHeatRectDetailInput : IValidatableObject
|
{
|
|
/// <summary>
|
/// 泵站
|
/// </summary>
|
|
[Required, Range(0, 1, ErrorMessage = "Station 不存在")]
|
public int Station { get; set; }
|
|
/// <summary>
|
/// 数据id
|
/// </summary>
|
public long ObjectID { get; set; }
|
|
/// <summary>
|
/// 流量最小值
|
/// </summary>
|
[Required]
|
public double Qmin { get; set; }
|
|
/// <summary>
|
/// 流量最大值
|
/// </summary>
|
[Required]
|
public double Qmax { get; set; }
|
|
/// <summary>
|
/// 扬程最小值
|
/// </summary>
|
[Required]
|
public double Hmin { get; set; }
|
|
/// <summary>
|
/// 扬程最大值
|
/// </summary>
|
[Required]
|
public double Hmax { get; set; }
|
|
/// <summary>
|
/// 开始日期 (应小于结束日期)
|
/// </summary>
|
[Required]
|
public DateTime StartDay { get; set; }
|
|
/// <summary>
|
/// 结束日期(应大于开始日期)
|
/// </summary>
|
[Required]
|
public DateTime EndDay { get; set; }
|
|
/// <summary>
|
///
|
/// </summary>
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
{
|
if (StartDay.Date > EndDay.Date)
|
{
|
yield return new ValidationResult(
|
"StartDay 必须小于等于 EndDay"
|
, new[] { nameof(StartDay) }
|
);
|
}
|
if (Qmin > Qmax)
|
{
|
yield return new ValidationResult(
|
"流量区间参数错误"
|
, new[] { nameof(Qmin) }
|
);
|
}
|
if (Hmin > Hmax)
|
{
|
yield return new ValidationResult(
|
"扬程区间参数错误"
|
, new[] { nameof(Hmin) }
|
);
|
}
|
}
|
|
|
}
|
}
|