You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

69 lines
1.6 KiB

using System;
using System.ComponentModel.DataAnnotations;
namespace Win_in.Sfs.Scp.WebApi.Asns;
/// <summary>
/// Beginning Segment
/// 事务头
/// </summary>
public class BSN
{
/// <summary>
/// Transaction Set Purpose
/// "00" = Original
/// "01" = Cancellation
/// 段落目的
/// </summary>
[StringLength(2, MinimumLength = 2)]
public string BSN01 { get; set; } = "00";
/// <summary>
/// Ship Notice Number
/// 发货通知单编号
/// </summary>
[StringLength(30, MinimumLength = 2)]
public string BSN02 { get; set; }
/// <summary>
/// Ship Notice Date
/// 发货日期
/// </summary>
[StringLength(6, MinimumLength = 6)]
public string BSN03 { get; set; }
/// <summary>
/// Ship Notice Time
/// 发货时间
/// </summary>
[StringLength(4, MinimumLength = 4)]
public string BSN04 { get; set; }
public string BSN05 { get; }
public string BSN06 { get; }
public string BSN07 { get; }
public BSN()
{
}
public BSN(string noticeNumber, DateTime datetime, string purpose = "00")
{
BSN01 = purpose;
BSN02 = noticeNumber;
BSN03 = datetime.ToString(X12Const.DateFormat);
BSN04 = datetime.ToString(X12Const.TimeFormat);
}
public override string ToString()
{
return "BSN"
+ X12Const.ElementSeparator + BSN01
+ X12Const.ElementSeparator + BSN02
+ X12Const.ElementSeparator + BSN03
+ X12Const.ElementSeparator + BSN04;
}
}