using Myshipping.Application.Entity;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Myshipping.Application.Service.ExpressDelivery.Dto
{
public class ExpressDeliveryDto : IValidatableObject
{
///
///主键
///
public long Id { get; set; }
///
/// 快递号
///
public string KDNO { get; set; }
///
/// 快递日期
///
public DateTime? Date { get; set; }
///
/// 快递当前状态编码
///
public string CurrentStateCode { get; set; }
///
/// 快递当前状态描述
///
public string CurrentStateDesc { get; set; }
///
/// 快递公司
///
public string KDCompany { get; set; }
///
/// 收件公司
///
public string SJCompany { get; set; }
///
/// 收件人
///
[Required(ErrorMessage = "收件人不能为空")]
public string SJPeople { get; set; }
///
/// 收件省份
///
public string SJProvince { get; set; }
///
/// 收件省份Id
///
public string SJProvinceId { get; set; }
///
/// 收件城市
///
public string SJCity { get; set; }
///
/// 收件地址
///
[Required(ErrorMessage = "收件人地址不能为空")]
public string SJAddress { get; set; }
///
/// 收件邮编
///
public string SJPostCode { get; set; }
///
/// 收件电话
///
[Required(ErrorMessage = "收件人电话不能为空")]
public string SJTel { get; set; }
///
/// 发件公司
///
public string FJCompany { get; set; }
///
/// 发件人
///
[Required(ErrorMessage = "发件人不能为空")]
public string FJPeople { get; set; }
///
/// 发件省份
///
public string FJProvince { get; set; }
///
/// 发件省份ID
///
public string FJProvinceId { get; set; }
///
/// 发件城市
///
public string FJCity { get; set; }
///
/// 发件地址
///
[Required(ErrorMessage = "发件人地址不能为空")]
public string FJAddress { get; set; }
///
/// 发件邮编
///
public string FJPostCode { get; set; }
///
/// 发件电话
///
[Required(ErrorMessage = "发件人电话不能为空")]
public string FJTel { get; set; }
///
/// 品名
///
public string GOODSNAME { get; set; }
///
/// 寄件数量
///
public int? KDNum { get; set; }
///
/// 快递费
///
public decimal? KDFee { get; set; }
///
/// 备注
///
public string Remark { get; set; }
///
/// 业务类型
///
public string YWType { get; set; }
///
/// 编号
///
public string KDCode { get; set; }
///
/// 船名
///
public string VESSEL { get; set; }
///
/// 航次
///
public string VOYNO { get; set; }
///
/// 委托单位
///
public string WTUnit { get; set; }
///
/// ETD
///
public DateTime? SETD { get; set; }
///
/// ETD
///
public DateTime? EETD { get; set; }
///
/// 结费类型代码;1:现结;2:月结;3:到付
///
[Required(ErrorMessage = "结费类型代码不能为空")]
public string SettleAccountsTypeCode { get; set; }
///
/// 月结卡号
///
public string MonthlyCard { get; set; }
public List Business { get; set; }
public IEnumerable Validate(ValidationContext validationContext)
{
if (SettleAccountsTypeCode == "2" && string.IsNullOrWhiteSpace(MonthlyCard))
{
yield return new ValidationResult(
"当结费类型为“月结”时,需选择“月结卡号”"
, new[] { nameof(MonthlyCard) }
);
}
}
}
}