using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IStation.Application
{
///
/// 获取维修单完工分页列表
///
public class GetRepairTaskFormFinishedPageListInput : IValidatableObject
{
///
/// 客户标识
///
[Required, Range(1, long.MaxValue, ErrorMessage = "CorpID 必须大于0")]
public long CorpID { get; set; }
///
/// 所属类型
///
public string BelongType { get; set; }
///
/// 所属标识
///
public long? BelongID { get; set; }
///
/// 设备标识
///
public long? ProductID { get; set; }
///
/// 维修人标识
///
public long? RepairUserID { get; set; }
///
/// 紧急程度
///
public Model.Repair.eUrgency? Urgency { get; set; }
///
/// 表单号
///
public string FormNo { get; set; }
///
/// 开始时间
///
public DateTime? StartTime { get; set; }
///
/// 结束时间
///
public DateTime? EndTime { get; set; }
///
/// 页索引
///
[Required, Range(1, int.MaxValue, ErrorMessage = "PageIndex 必须大于0")]
public int PageIndex { get; set; }
///
/// 页尺寸
///
[Required, Range(1, int.MaxValue, ErrorMessage = "PageSize 必须大于0")]
public int PageSize { get; set; }
///
///
///
public IEnumerable Validate(ValidationContext validationContext)
{
if (StartTime.HasValue && EndTime.HasValue)
{
if (StartTime > EndTime)
{
yield return new ValidationResult(
"StartTime 必须小于 EndTime"
, new[] { nameof(StartTime) }
);
}
}
}
}
}