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; }
///
/// 快递公司
///
[Required(ErrorMessage = "快递公司不能为空")]
public string KDCompany { get; set; }
///
/// 收件公司
///
public string SJCompany { get; set; }
///
/// 收件人
///
[Required(ErrorMessage = "收件人不能为空")]
public string SJPeople { get; set; }
///
/// 收件省份
///
public string SJProvince { get; set; }
///
/// 收件省份Id
///
[Required(ErrorMessage = "收件省份不能为空")]
public string SJProvinceId { get; set; }
///
/// 收件城市
///
[Required(ErrorMessage = "收件城市不能为空")]
public string SJCity { get; set; }
///
/// 收件地址
///
[Required(ErrorMessage = "收件人地址不能为空")]
public string SJAddress { get; set; }
///
/// 收件电话
///
[Required(ErrorMessage = "收件人电话不能为空")]
public string SJTel { get; set; }
///
/// 寄件公司
///
public string FJCompany { get; set; }
///
/// 寄件人
///
[Required(ErrorMessage = "寄件人不能为空")]
public string FJPeople { get; set; }
///
/// 寄件省份
///
[Required(ErrorMessage = "寄件省份不能为空")]
public string FJProvince { get; set; }
///
/// 寄件省份ID
///
public string FJProvinceId { get; set; }
///
/// 寄件城市
///
[Required(ErrorMessage = "寄件城市不能为空")]
public string FJCity { get; set; }
///
/// 寄件地址
///
[Required(ErrorMessage = "寄件详细地址不能为空")]
public string FJAddress { get; set; }
///
/// 发件电话
///
[Required(ErrorMessage = "发件人电话不能为空")]
public string FJTel { get; set; }
///
/// 品名
///
public string GOODSNAME { get; set; }
///
/// 寄件数量
///
public int? KDNum { get; set; }
///
/// 计费重量(带单位)
///
public string FeeWeight { 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 List FeeList { get; set; }
///
/// 保存的同时,是否下单快递
///
public bool IsSending { get; set; }
public IEnumerable Validate(ValidationContext validationContext)
{
if (SettleAccountsTypeCode == "2" && string.IsNullOrWhiteSpace(MonthlyCard))
{
yield return new ValidationResult(
"当结费类型为“月结”时,需选择“月结卡号”"
, new[] { nameof(MonthlyCard) }
);
}
}
}
}