using System;
|
using System.Collections.Generic;
|
using System.ComponentModel.DataAnnotations;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace IStation.Application
|
{
|
/// <summary>
|
/// 重新分析年区间内的常规监测年记录Input
|
/// </summary>
|
public class AnalyAgainMonitorGeneralYearRecordOfYearRangeInput : IValidatableObject
|
{
|
/// <summary>
|
/// 客户id
|
/// </summary>
|
[Required, Range(1, long.MaxValue, ErrorMessage = "CorpID 必须大于0")]
|
public long CorpID { get; set; }
|
|
/// <summary>
|
/// 常规实时测点id
|
/// </summary>
|
[Required, Range(1, long.MaxValue, ErrorMessage = "MonitorPointID 必须大于0")]
|
public long MonitorPointID { get; set; }
|
|
/// <summary>
|
/// 开始年份
|
/// </summary>
|
public int StartYear { get; set; }
|
|
/// <summary>
|
/// 结束月份
|
/// </summary>
|
public int EndYear { get; set; }
|
|
|
/// <summary>
|
///
|
/// </summary>
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
{
|
if(StartYear>EndYear)
|
{
|
yield return new ValidationResult(
|
"年份区间参数错误"
|
, new[] { nameof(StartYear) }
|
);
|
|
}
|
}
|
|
|
|
}
|
}
|