43 lines
1.0 KiB
C#
43 lines
1.0 KiB
C#
using Dlhis.Entity.Basic.Enums;
|
|
using Kurisu.AspNetCore.Utils.Extensions;
|
|
using Kurisu.Core.DataAccess.Dto;
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace Dlhis.Basic.Organization.Request;
|
|
|
|
public class GainfoPageRequest : PageDto, IValidatableObject
|
|
{
|
|
/// <summary>
|
|
/// 档案类型
|
|
/// </summary>
|
|
[EnumDataType(typeof(GainfoStatusEnumType))]
|
|
public GainfoStatusEnumType? Status { get; set; } = GainfoStatusEnumType.Working;
|
|
|
|
/// <summary>
|
|
/// 部门选择
|
|
/// </summary>
|
|
public List<TenantDepartmentRequest> DepartmentSelections { get; set; } = new List<TenantDepartmentRequest>();
|
|
|
|
|
|
/// <summary>
|
|
/// 是否为外包
|
|
/// </summary>
|
|
public bool? IsOutSource { get; set; }
|
|
|
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
|
{
|
|
DepartmentSelections.ForEach(d =>
|
|
{
|
|
//存在
|
|
if (d.DepartmentNos.IsPresent())
|
|
{
|
|
d.DepartmentNos.Remove(d.Tenant);
|
|
}
|
|
});
|
|
|
|
|
|
|
|
yield break;
|
|
}
|
|
}
|