23 lines
636 B
C#
23 lines
636 B
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace Dlhis.Basic.Organization.Request
|
|
{
|
|
public class GainfoOutResignRequest : IValidatableObject
|
|
{
|
|
public long Id { get; set; }
|
|
|
|
[Required]
|
|
public string Reason { get; set; }
|
|
|
|
public DateTime Date { get; set; }
|
|
|
|
/// <inheritdoc />
|
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
|
{
|
|
if (Date < DateTime.Now.Date)
|
|
{
|
|
yield return new ValidationResult("离职日期不能小于当前时间", new[] { nameof(Date) });
|
|
}
|
|
}
|
|
}
|
|
} |