|
|
@ -103,7 +103,7 @@ public class BBAC_SA_DETAIL_DTO : AuditedAggregateRoot<Guid> |
|
|
|
/// <summary>
|
|
|
|
/// BBAC结算导入请求
|
|
|
|
/// </summary>
|
|
|
|
public class BBACSaImportRequestDto //: IValidatableObject
|
|
|
|
public class BBACSaImportRequestDto |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// 文件
|
|
|
@ -119,42 +119,7 @@ public class BBACSaImportRequestDto //: IValidatableObject |
|
|
|
/// </summary>
|
|
|
|
[Display(Name = "地点")] |
|
|
|
[Required(ErrorMessage = "{0}必须填写")] |
|
|
|
//[ValidateSite(Sites = new string[] { "1040", "1046" }, ErrorMessage = "{0}值无效")]
|
|
|
|
public string Site { get; set; } |
|
|
|
|
|
|
|
//public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
|
|
|
//{
|
|
|
|
// if (Site != "1040" && Site != "1046")
|
|
|
|
// {
|
|
|
|
// yield return new ValidationResult(
|
|
|
|
// $"地点值无效",
|
|
|
|
// new[] { nameof(Site) });
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
} |
|
|
|
|
|
|
|
public class ValidateSiteAttribute : ValidationAttribute |
|
|
|
{ |
|
|
|
public ValidateSiteAttribute() |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public string[] Sites { get; set; } |
|
|
|
|
|
|
|
protected override ValidationResult IsValid(object value, ValidationContext validationContext) |
|
|
|
{ |
|
|
|
if (!Sites.Contains(value)) |
|
|
|
{ |
|
|
|
return new ValidationResult(FormatErrorMessage(validationContext.DisplayName)); |
|
|
|
} |
|
|
|
return ValidationResult.Success; |
|
|
|
} |
|
|
|
|
|
|
|
//public override bool IsValid(object value)
|
|
|
|
//{
|
|
|
|
// return AllowEmptyStrings || value is not string stringValue || !string.IsNullOrWhiteSpace(stringValue);
|
|
|
|
// return base.IsValid(value);
|
|
|
|
//}
|
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|