VisaCommissionDto.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. using EyeSoft.Collections.Generic;
  2. using FluentValidation;
  3. using Org.BouncyCastle.Utilities;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace OASystem.Domain.Dtos.Groups
  10. {
  11. public class VisaCommissionDto
  12. {
  13. }
  14. public class VisaCommissionItemDto : PortDtoBase
  15. {
  16. public int CurrUserId { get; set; }
  17. public int DiId { get; set; }
  18. }
  19. public class VisaCommissionItemDtoValidator : AbstractValidator<VisaCommissionItemDto>
  20. {
  21. public VisaCommissionItemDtoValidator() {
  22. RuleFor(x => x.PortType).InclusiveBetween(from: 1, to: 3)
  23. .WithMessage(MsgTips.Port);
  24. RuleFor(x => x.CurrUserId).GreaterThan(valueToCompare: 1)
  25. .WithMessage("请输入有效的CurrUserId!");
  26. RuleFor(x => x.DiId).GreaterThan(valueToCompare: 1)
  27. .WithMessage("请输入有效的DiId!");
  28. }
  29. }
  30. public class VisaCommissionSaveDto
  31. {
  32. public VisaCommissionCreateView[] Items { get; set; }
  33. }
  34. public class VisaCommissionCreateView
  35. {
  36. /// <summary>
  37. /// ID
  38. /// ID<1 添加
  39. /// ID>0 修改
  40. /// </summary>
  41. public int Id { get; set; }
  42. /// 用户ID
  43. /// </summary>
  44. public int CurrUserId { get; set; }
  45. /// <summary>
  46. /// 团组ID
  47. /// </summary>
  48. public int DiId { get; set; }
  49. /// <summary>
  50. /// 国家
  51. /// </summary>
  52. public string Country { get; set; }
  53. /// <summary>
  54. /// 数量
  55. /// </summary>
  56. public int Quantity { get; set; }
  57. /// <summary>
  58. /// 备注
  59. /// </summary>
  60. public string Remark { get; set; }
  61. }
  62. /// <summary>
  63. /// Create Dto
  64. /// </summary>
  65. public class VisaCommissionCreateDto
  66. {
  67. /// <summary>
  68. /// 用户ID
  69. /// </summary>
  70. public int CurrUserId { get; set; }
  71. /// <summary>
  72. /// 团组ID
  73. /// </summary>
  74. public int DiId { get; set; }
  75. /// <summary>
  76. /// 国家
  77. /// </summary>
  78. public string Country { get; set; }
  79. /// <summary>
  80. /// 数量
  81. /// </summary>
  82. public int Quantity { get; set; }
  83. /// <summary>
  84. /// 备注
  85. /// </summary>
  86. public string Remark { get; set; }
  87. }
  88. public class VisaCommissionCreateDtoValidator : AbstractValidator<VisaCommissionCreateDto>
  89. {
  90. public VisaCommissionCreateDtoValidator()
  91. {
  92. RuleFor(x => x.CurrUserId).GreaterThan(valueToCompare: 0)
  93. .WithMessage("请输入有效的CurrUserId!");
  94. RuleFor(x => x.DiId).GreaterThan(valueToCompare: 0)
  95. .WithMessage("请输入有效的DiId!");
  96. RuleFor(x => x.Country).NotEmpty()
  97. .WithMessage("国家不能为空!");
  98. RuleFor(x => x.Quantity).GreaterThan(valueToCompare: 0)
  99. .WithMessage("请输入有效的Qauntity!");
  100. }
  101. }
  102. }