39 lines
1013 B
C#
39 lines
1013 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using Kurisu.Core.CustomClass;
|
|
|
|
namespace Dlhis.Basic.BusinessShift.Request;
|
|
|
|
public class BusinessPlaceShiftSaveRequest : IValidatableObject
|
|
{
|
|
public long? Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// 营业点代号
|
|
/// </summary>
|
|
[Required(ErrorMessage = "营业点不能为空")]
|
|
public Guid BusinessPlaceCode { get; set; }
|
|
|
|
/// <summary>
|
|
/// 自定义代号
|
|
/// </summary>
|
|
public string CustomCode { get; set; }
|
|
|
|
/// <summary>
|
|
/// 序号
|
|
/// </summary>
|
|
public int Sequence { get; set; } = 100;
|
|
|
|
/// <summary>
|
|
/// 时间段
|
|
/// </summary>
|
|
public TimePeriod TimePeriod { get; set; }
|
|
|
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
|
{
|
|
if (TimePeriod.Start == TimePeriod.End)
|
|
{
|
|
yield return new ValidationResult("时间段设置区间有误,开始时段不能等于结束时段.", new[] { nameof(TimePeriod) });
|
|
}
|
|
}
|
|
}
|