using EyeSoft.Collections.Generic; using FluentValidation; using Org.BouncyCastle.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace OASystem.Domain.Dtos.Groups { public class VisaCommissionDto { } public class VisaCommissionItemDto : PortDtoBase { public int CurrUserId { get; set; } public int DiId { get; set; } } public class VisaCommissionItemDtoValidator : AbstractValidator { public VisaCommissionItemDtoValidator() { RuleFor(x => x.PortType).InclusiveBetween(from: 1, to: 3) .WithMessage(MsgTips.Port); RuleFor(x => x.CurrUserId).GreaterThan(valueToCompare: 1) .WithMessage("请输入有效的CurrUserId!"); RuleFor(x => x.DiId).GreaterThan(valueToCompare: 1) .WithMessage("请输入有效的DiId!"); } } public class VisaCommissionSaveDto { public VisaCommissionCreateView[] Items { get; set; } } public class VisaCommissionCreateView { /// /// ID /// ID<1 添加 /// ID>0 修改 /// public int Id { get; set; } /// 用户ID /// public int CurrUserId { get; set; } /// /// 团组ID /// public int DiId { get; set; } /// /// 国家 /// public string Country { get; set; } /// /// 数量 /// public int Quantity { get; set; } /// /// 备注 /// public string Remark { get; set; } } /// /// Create Dto /// public class VisaCommissionCreateDto { /// /// 用户ID /// public int CurrUserId { get; set; } /// /// 团组ID /// public int DiId { get; set; } /// /// 国家 /// public string Country { get; set; } /// /// 数量 /// public int Quantity { get; set; } /// /// 备注 /// public string Remark { get; set; } } public class VisaCommissionCreateDtoValidator : AbstractValidator { public VisaCommissionCreateDtoValidator() { RuleFor(x => x.CurrUserId).GreaterThan(valueToCompare: 0) .WithMessage("请输入有效的CurrUserId!"); RuleFor(x => x.DiId).GreaterThan(valueToCompare: 0) .WithMessage("请输入有效的DiId!"); RuleFor(x => x.Country).NotEmpty() .WithMessage("国家不能为空!"); RuleFor(x => x.Quantity).GreaterThan(valueToCompare: 0) .WithMessage("请输入有效的Qauntity!"); } } }