lixiaojun
2023-03-20 14801a2e40bc79833c41151a37fe4cb0acbc5c7f
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace IStation.Application
{
    /// <summary>
    /// 获取维修单完工分页列表
    /// </summary>
    public class GetRepairTaskFormFinishedPageListInput : IValidatableObject
    {
        /// <summary>
        /// 客户标识
        /// </summary>
        [Required, Range(1, long.MaxValue, ErrorMessage = "CorpID 必须大于0")]
        public long CorpID { get; set; }
 
        /// <summary>
        /// 所属类型
        /// </summary>
        public string BelongType { get; set; }
 
        /// <summary>
        /// 所属标识
        /// </summary>
        public long? BelongID { get; set; }
 
        /// <summary>
        /// 设备标识
        /// </summary>
        public long? ProductID { get; set; }
 
        /// <summary>
        /// 维修人标识
        /// </summary>
        public long? RepairUserID { get; set; }
 
        /// <summary>
        /// 紧急程度
        /// </summary>
        public Model.Repair.eUrgency? Urgency { get; set; }
 
        /// <summary>
        /// 表单号
        /// </summary>
        public string FormNo { get; set; }
 
        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime? StartTime { get; set; }
 
        /// <summary>
        /// 结束时间
        /// </summary>
        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.HasValue && EndTime.HasValue)
            {
                if (StartTime > EndTime)
                {
                    yield return new ValidationResult(
                   "StartTime 必须小于 EndTime"
                   , new[] { nameof(StartTime) }
                    );
                }
            }
        }
 
 
 
    }
}