21 lines
607 B
C#
21 lines
607 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using Kurisu.AspNetCore.CustomClass;
|
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
|
|
|
namespace Dlhis.Canteen.Voucher.Requests;
|
|
|
|
public class EMealVoucherPageRequest : PageDto, IValidatableObject
|
|
{
|
|
public DateTimePeriod SearchDateTimePeriod { get; set; }
|
|
|
|
/// <inheritdoc />
|
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
|
{
|
|
if (SearchDateTimePeriod.HasValue())
|
|
{
|
|
SearchDateTimePeriod.End = SearchDateTimePeriod.Start!.Value.AddDays(1).AddSeconds(-1);
|
|
}
|
|
|
|
yield break;
|
|
}
|
|
} |