|
@ -1,5 +1,7 @@ |
|
|
using System; |
|
|
using System; |
|
|
|
|
|
using System.Collections.Generic; |
|
|
using System.ComponentModel.DataAnnotations; |
|
|
using System.ComponentModel.DataAnnotations; |
|
|
|
|
|
using System.Linq; |
|
|
using Magicodes.ExporterAndImporter.Core; |
|
|
using Magicodes.ExporterAndImporter.Core; |
|
|
using Microsoft.AspNetCore.Http; |
|
|
using Microsoft.AspNetCore.Http; |
|
|
using Volo.Abp.Application.Dtos; |
|
|
using Volo.Abp.Application.Dtos; |
|
@ -101,7 +103,7 @@ public class BBAC_SA_DETAIL_DTO : AuditedAggregateRoot<Guid> |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// BBAC结算导入请求
|
|
|
/// BBAC结算导入请求
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public class BBACSaImportRequestDto |
|
|
public class BBACSaImportRequestDto //: IValidatableObject
|
|
|
{ |
|
|
{ |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 文件
|
|
|
/// 文件
|
|
@ -116,7 +118,43 @@ public class BBACSaImportRequestDto |
|
|
/// 地点
|
|
|
/// 地点
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
[Display(Name = "地点")] |
|
|
[Display(Name = "地点")] |
|
|
|
|
|
[Required(ErrorMessage = "{0}必须填写")] |
|
|
|
|
|
//[ValidateSite(Sites = new string[] { "1040", "1046" }, ErrorMessage = "{0}值无效")]
|
|
|
public string Site { get; set; } |
|
|
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>
|
|
|
/// <summary>
|
|
|