24 lines
714 B
C#
24 lines
714 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using Dlhis.Entity.Sys.Enums;
|
|
|
|
namespace Dlhis.Sys.DataPermission.Request;
|
|
|
|
public class DataPermissionSaveRequest : IValidatableObject
|
|
{
|
|
[Required]
|
|
public string AssignValue { get; set; }
|
|
|
|
[EnumDataType(typeof(DeviceAssignmentTypeEnumType))]
|
|
public DeviceAssignmentTypeEnumType UniqueType { get; set; }
|
|
|
|
public List<Guid> Codes { get; set; } = new();
|
|
|
|
|
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
|
{
|
|
if (UniqueType == DeviceAssignmentTypeEnumType.BusinessPlace)
|
|
{
|
|
yield return new ValidationResult("不支持营业点分配", new[] { nameof(UniqueType) });
|
|
}
|
|
}
|
|
} |