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