Generate EDIFACT UNG

Download EDIFACT UNG C# Sample


///
/// Build UNG.
/// 
public static UNG BuildUng(string controlNumber, string transactionType)
{
	return new UNG
	{
		//  The type of messages in the group, INVOIC, etc.
		MessageGroupIdentification_1 = transactionType,
		APPLICATIONSENDERIDENTIFICATION_2 = new S006
		{
			//  Sender identification
			ApplicationSenderIdentification_1 = "SENDERID",
			IdentificationCodeQualifier_2 = "ZZZ"
		},
		APPLICATIONRECIPIENTIDENTIFICATION_3 = new S007
		{
			//  Recipient identification
			ApplicationRecipientIdentification_1 = "RECEIVERID",
			IdentificationCodeQualifier_2 = "ZZZ"
		},
		DATEANDTIMEOFPREPARATION_4 = new S004
		{
			//  Date
			Date_1 = DateTime.Now.Date.ToString("yyMMdd"),
			//  Time
			Time_2 = DateTime.Now.TimeOfDay.ToString("hhmm")
		},
		//  Group control reference
		GroupReferenceNumber_5 = controlNumber,
		//  Controlling agency
		ControllingAgency_6 = "UN"
	};
}
Was this article helpful?
0 out of 0 found this helpful