lixiaojun
2024-03-25 2fbfc7930364dffbb846d018226755ab66f5bcfb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
namespace Yw.Dto
{
    /// <summary>
    /// 获取我的被驳回报修单分页列表
    /// </summary>
    public class QueryMyRepairRequestFormRejectedPageListInput : IValidatableObject
    {
 
        /// <summary>
        /// 紧急程度
        /// </summary>
        public eUrgency? Urgency { get; set; }
 
        /// <summary>
        /// 开始时间
        /// </summary>
        [Required]
        public DateTime StartTime { get; set; }
 
        /// <summary>
        /// 结束时间
        /// </summary>
 
        [Required]
        public DateTime EndTime { get; set; }
 
        /// <summary>
        /// 页索引
        /// </summary>
 
        [Required, Range(1, int.MaxValue, ErrorMessage = "PageIndex 必须大于0")]
        public int PageIndex { get; set; }
 
        /// <summary>
        /// 页尺寸
        /// </summary>
 
        [Required, Range(1, int.MaxValue, ErrorMessage = "PageSize 必须大于0")]
        public int PageSize { get; set; }
 
 
        /// <summary>
        /// 
        /// </summary>
        public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
        {
            if (StartTime > EndTime)
            {
                yield return new ValidationResult(
                        "StartTime 必须小于 EndTime"
                       , new[] { nameof(StartTime) }
                   );
            }
        }
    }
}