31 lines
798 B
C#
31 lines
798 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace Dlhis.Basic.Organization.Request;
|
|
|
|
public class GainfoResignRequest : IValidatableObject
|
|
{
|
|
public long Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// 离职原因
|
|
/// </summary>
|
|
[Required(ErrorMessage = "离职原因不能为空")]
|
|
public string Reason { get; set; }
|
|
|
|
public DateTime Date { get; set; } = DateTime.Now;
|
|
|
|
/// <summary>
|
|
/// 是否外包
|
|
/// </summary>
|
|
public bool IsOutsource { get; set; } = true;
|
|
|
|
|
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
|
{
|
|
if (Date < DateTime.Now.Date)
|
|
{
|
|
yield return new ValidationResult("离职日期不能小于当前时间", new[] { nameof(Date) });
|
|
}
|
|
}
|
|
} |