You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
BookingHeChuan/Myshipping.Application/EDI/MellEdiHelper.cs

1392 lines
63 KiB
C#

using NPOI.OpenXmlFormats.Spreadsheet;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Myshipping.Application.EDI
{
/// <summary>
/// 太平玛利亚
/// </summary>
public class MellEdiHelper
{
public MellEdiHelper()
{
}
/*
public static string IsCreatePILMELL(EDIBaseModel InttrEdi)
{
//T_ALL_DA T_ALL_DA = new T_ALL_DA();
var error = "";
foreach (var bill in InttrEdi.BSLIST)
{
//var OpBill = MsOpSeaeDAL.MsOpSeaeDAL.GetBillData("BSNO='" + bill.BSNO + "'");
//var billams = GetAmsData("BSNO='" + bill.BSNO + "'");
int IsNADFW = 1;
if (InttrEdi.filetype == "B")
{
if (InttrEdi.UseForWarderCode)
{
if (InttrEdi.ForWarderCode?.Trim() == "")
{ error = error + "<br />货代代码不能为空"; }
if (InttrEdi.ForWarderName.Trim() == "")
{ error = error + "<br />货代称呼不能为空"; }
if (bill.ORDERNO.Trim() == "")
{ error = error + "<br />订舱编号不能为空"; }
}
}
if (bill.OpEName == null || bill.OP == "")
{ error = error + "<br />操作不能为空"; }
else
{
if (dsUserOp != null)
{
if (dsUserOp.Tables[0].Rows.Count > 0)
{
if (carrier != "YML")
{
if (dsUserOp.Tables[0].Rows[0]["USERNAME"].ToString().Trim() == "")
{ error = error + "<br />操作的英文名不能为空"; }
if (dsUserOp.Tables[0].Rows[0]["OFFICEPHONE"].ToString().Trim() == "")
{ error = error + "<br />操作的电话不能为空"; }
//if (dsUserOp.Tables[0].Rows[0]["EMAIL1"].ToString().Trim() == "")
//{ error = error + "<br />操作的邮箱不能为空"; }
}
}
else
{
{ error = error + "<br />操作的信息不能为空"; }
}
}
else
{
{ error = error + "<br />操作的信息不能为空"; }
}
}
if (bill.SERVICE == "DOOR-DOOR" || bill.SERVICE == "DOOR-CY" || bill.SERVICE == "CY-DOOR")
{
if (bill.CARRIER != "YML")
{
if (bill.ATTN == null || bill.ATTN == "")
{ error = error + "<br />EDI信息联系人不能为空"; }
if (billams.ATTNTEL == null || billams.ATTNTEL == "")
{ error = error + "<br />EDI信息联系人电话不能为空"; }
if (billams.ATTNEMAIL == null || billams.ATTNEMAIL == "")
{ error = error + "<br />EDI信息联系人邮箱不能为空"; }
}
}
if (bill.CARGOID == "D")
{
if (carrier != "YML")
{
if (string.IsNullOrEmpty(billams.ATTN))
{
}
else
{
if (billams.ATTN == null || billams.ATTN == "")
{ error = error + "<br />EDI信息联系人不能为空"; }
if (billams.ATTNTEL == null || billams.ATTNTEL == "")
{ error = error + "<br />EDI信息联系人电话不能为空"; }
if (billams.ATTNEMAIL == null || billams.ATTNEMAIL == "")
{ error = error + "<br />EDI信息联系人邮箱不能为空"; }
}
}
}
if (bill.MBLNO == null || bill.MBLNO == "")
{ }
else
{
if (StringIsChinese(bill.MBLNO))
{
error = error + "<br />提单号:" + bill.MBLNO + " 提单号含有中文或双字节字符";
}
}
if (isbill == 1)
{
if (OpBill.MBLNO == null || OpBill.MBLNO == "")
{ error = error + "<br />分票提单主提单号不能为空"; }
else
{
if (StringIsChinese(OpBill.MBLNO))
{
error = error + "<br />提单号:" + bill.MBLNO + " 提单号含有中文或双字节字符";
}
}
}
if ((bill.BLFRT == null || bill.BLFRT == ""))
{ error = error + "<br />提单号:" + bill.MBLNO + " 付费方式不能为空"; }
//if (filetype == "E")
//{
//if (carrier != "MAEU")
//if ((bill.HSCODE == null || bill.HSCODE == ""))
//{ error = error + "<br />提单号:" + bill.MBLNO + " HSCODE不能为空"; }
if (carrier != "MCCQ" && carrier != "MAEU" && carrier != "SUDU")
{
if (bill.VESSEL == null || bill.VESSEL == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 船名不能为空"; }
if (bill.VOYNO == null || bill.VOYNO == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 航次不能为空"; }
}
//}
if (filetype == "E")
{
if (billams.SIREMARK.IndexOf("PLEASE BOOK OCEAN CARRIER") > -1 || billams.SIREMARK.ToString().Trim() == "")
{
if (carrier == "COSU")
{
error = error + "<br />提单号:" + bill.MBLNO + " 请在SI备注中输入:COSCO 销售的营销代码(此代码船公司会直接提供)";
}
else
{
//if (carrier != "YML")
//error = error + "<br />提单号:" + bill.MBLNO + " EDI备注中不能为空";
}
}
else
{
if (StringIsChinese(billams.SIREMARK))
{
error = error + "<br />提单号:" + bill.MBLNO + " SI备注中含有中文或双字节字符";
}
//if (bill.EDIREMARK.ToString().Trim()!="" && BasicDataRefDAL.isHasChinese(bill.EDIREMARK))
//{
// error = error + "<br />提单号:" + bill.MBLNO + " 请在EDI备注中输入:英文(不允许录入中文)";
//}
}
}
else
{
if (bill.EDIREMARK.IndexOf("PLEASE BOOK OCEAN CARRIER") > -1 || bill.EDIREMARK.ToString().Trim() == "")
{
if (carrier == "COSU")
{
error = error + "<br />提单号:" + bill.MBLNO + " 请在EDI备注中输入:COSCO 销售的营销代码(此代码船公司会直接提供)";
}
else
{
//if (carrier != "YML")
//error = error + "<br />提单号:" + bill.MBLNO + " EDI备注中不能为空";
}
}
else
{
if (StringIsChinese(bill.EDIREMARK))
{
error = error + "<br />提单号:" + bill.MBLNO + " EDI备注中含有中文或双字节字符";
}
//if (bill.EDIREMARK.ToString().Trim()!="" && BasicDataRefDAL.isHasChinese(bill.EDIREMARK))
//{
// error = error + "<br />提单号:" + bill.MBLNO + " 请在EDI备注中输入:英文(不允许录入中文)";
//}
}
}
if (bill.CARRIER == null || bill.CARRIER == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 船公司不能为空"; }
else
{
if (GetCustEdi(bill.CARRIER) == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 船公司EDI代码不能为空"; }
}
if (billams.BYCOUNTRY != "" && carrier != "OOLU")
{
if (billams.AMSSHIPPER == "")
{
error = error + "<br />提单号:" + bill.MBLNO + " AMS发货人不能为空";
}
else
{
if (StringIsChinese(billams.AMSSHIPPER))
{
error = error + "<br />提单号:" + bill.MBLNO + " AMS发货人含有中文或双字节字符";
}
else
{
//if (carrier == "HLCU")
//{
// error += formatlengthError("txt", billams.AMSSHIPPER, 35, bill.MBLNO, "AMS发货人", 6, "-", false);
//}
//else
//{
// error += formatlengthError("txt", billams.AMSSHIPPER, 35, bill.MBLNO, "AMS发货人", 6, "*", false);
//}
}
}
}
else
{
if (bill.SHIPPER == "")
{
error = error + "<br />提单号:" + bill.MBLNO + " 发货人不能为空";
}
else
{
if (StringIsChinese(bill.SHIPPER))
{
error = error + "<br />提单号:" + bill.MBLNO + " 发货人含有中文或双字节字符";
}
else
{
//if (carrier == "HLCU")
//{
// error += formatlengthError("txt", bill.SHIPPER, 35, bill.MBLNO, "发货人", 6, "-", false);
//}
//else
//{
// error += formatlengthError("txt", bill.SHIPPER, 35, bill.MBLNO, "发货人", 6, "*", false);
//}
}
}
}
if (isbill == 1)
{
if (OpBill.SHIPPER == "")
{
error = error + "<br />提单号:" + bill.MBLNO + " 分单发货人不能为空";
}
else
{
if (StringIsChinese(OpBill.SHIPPER))
{
error = error + "<br />提单号:" + bill.MBLNO + " 分单发货人含有中文或双字节字符";
}
else
{
//if (carrier == "HLCU")
//{
// error += formatlengthError("txt", OpBill.SHIPPER, 35, bill.MBLNO, "分单发货人", 6, "-", false);
//}
//else
//{
// error += formatlengthError("txt", OpBill.SHIPPER, 35, bill.MBLNO, "分单发货人", 6, "*", false);
//}
}
}
}
if (billams.BYCOUNTRY != "" && carrier != "OOLU")
{
if (billams.AMSCONSIGNEE == "")
{
error = error + "<br />提单号:" + bill.MBLNO + " AMS收货人不能为空";
}
else
{
if (StringIsChinese(billams.AMSCONSIGNEE))
{
error = error + "<br />提单号:" + bill.MBLNO + " AMS收货人含有中文或双字节字符";
}
else
{
//if (carrier == "HLCU")
//{
// error += formatlengthError("txt", billams.AMSCONSIGNEE, 35, bill.MBLNO, "AMS收货人", 6, "--", false);
//}
//else
//{
// error += formatlengthError("txt", billams.AMSCONSIGNEE, 35, bill.MBLNO, "AMS收货人", 6, "**", false);
//}
}
}
}
else
{
if (bill.CONSIGNEE == "")
{
error = error + "<br />提单号:" + bill.MBLNO + " 收货人不能为空";
}
else
{
if (StringIsChinese(bill.CONSIGNEE))
{
error = error + "<br />提单号:" + bill.MBLNO + " 收货人含有中文或双字节字符";
}
else
{
//if (carrier == "HLCU")
//{
// error += formatlengthError("txt", bill.CONSIGNEE, 35, bill.MBLNO, "收货人", 6, "--", false);
//}
//else
//{
// error += formatlengthError("txt", bill.CONSIGNEE, 35, bill.MBLNO, "收货人", 6, "**", false);
//}
}
}
}
if (isbill == 1)
{
if (OpBill.CONSIGNEE == "")
{
error = error + "<br />提单号:" + bill.MBLNO + " 分单收货人不能为空";
}
else
{
if (StringIsChinese(OpBill.CONSIGNEE))
{
error = error + "<br />提单号:" + bill.MBLNO + " 分单收货人含有中文或双字节字符";
}
else
{
//if (carrier == "HLCU")
//{
// error += formatlengthError("txt", OpBill.CONSIGNEE, 35, bill.MBLNO, "分单收货人", 6, "--", false);
//}
//else
//{
// error += formatlengthError("txt", OpBill.CONSIGNEE, 35, bill.MBLNO, "分单收货人", 6, "**", false);
//}
}
}
}
//if (filetype == "E")
//{
// if (bill.AGENT == "")
// {
// error = error + "<br />提单号:" + bill.MBLNO + " 代理不能为空";
// }
// else
// {
// if (StringIsChinese(bill.AGENT))
// {
// error = error + "<br />提单号:" + bill.MBLNO + " 代理含有中文或双字节字符";
// }
// else
// {
// if (carrier == "HLCU")
// {
// error += formatlengthError("txt", bill.AGENT, 35, bill.MBLNO, "代理", 5, "----");
// }
// else
// {
// error += formatlengthError("txt", bill.AGENT, 35, bill.MBLNO, "代理", 5, "****");
// }
// }
// }
//}
if (bill.SERVICE == "CY-DOOR")
{
if (billams.DOORADDR == "")
{
error = error + "<br />提单号:" + bill.MBLNO + " 运输条款为:CY-DOOREDI信息中的DOOR地址不能为空";
}
else
{
if (StringIsChinese(billams.DOORADDR))
{
error = error + "<br />提单号:" + bill.MBLNO + " DOOR地址含有中文或双字节字符";
}
}
}
if (bill.SERVICE == "DOOR-CY")
{
if (billams.ATTNADDR == "")
{
error = error + "<br />提单号:" + bill.MBLNO + " 运输条款为:DOOR-CYEDI信息中的联系人地址不能为空";
}
else
{
if (StringIsChinese(billams.ATTNADDR))
{
error = error + "<br />提单号:" + bill.MBLNO + " 联系人地址含有中文或双字节字符";
}
}
}
if (billams.BYCOUNTRY != "" && carrier != "OOLU")
{
if (billams.AMSNOTIFYPARTY == "")
{
error = error + "<br />提单号:" + bill.MBLNO + " AMS通知人不能为空";
}
else
{
if (StringIsChinese(billams.AMSNOTIFYPARTY))
{
error = error + "<br />提单号:" + bill.MBLNO + " AMS通知人含有中文或双字节字符";
}
else
{
//if (carrier == "HLCU")
//{
// error += formatlengthError("txt", billams.AMSNOTIFYPARTY, 35, bill.MBLNO, "AMS通知人", 6, "---", false);
//}
//else
//{
// error += formatlengthError("txt", billams.AMSNOTIFYPARTY, 35, bill.MBLNO, "AMS通知人", 6, "***", false);
//}
}
}
}
else
{
if (bill.NOTIFYPARTY == "")
{
error = error + "<br />提单号:" + bill.MBLNO + " 通知人不能为空";
}
else
{
if (StringIsChinese(bill.NOTIFYPARTY))
{
error = error + "<br />提单号:" + bill.MBLNO + " 通知人含有中文或双字节字符";
}
else
{
//if (carrier == "HLCU")
//{
// error += formatlengthError("txt", bill.NOTIFYPARTY, 35, bill.MBLNO, "通知人", 6, "---", false);
//}
//else
//{
// error += formatlengthError("txt", bill.NOTIFYPARTY, 35, bill.MBLNO, "通知人", 6, "***", false);
//}
}
}
}
if (isbill == 1)
{
if (OpBill.NOTIFYPARTY == "")
{
error = error + "<br />提单号:" + bill.MBLNO + " 分单通知人不能为空";
}
else
{
if (StringIsChinese(OpBill.NOTIFYPARTY))
{
error = error + "<br />提单号:" + bill.MBLNO + " 分单通知人含有中文或双字节字符";
}
else
{
//if (carrier == "HLCU")
//{
// error += formatlengthError("txt", OpBill.NOTIFYPARTY, 35, bill.MBLNO, "分单通知人", 6, "---", false);
//}
//else
//{
// error += formatlengthError("txt", OpBill.NOTIFYPARTY, 35, bill.MBLNO, "分单通知人", 6, "***", false);
//}
}
}
}
if (isbill == 1)
{
if (OpBill.MARKS == "")
{
error = error + "<br />提单号:" + OpBill.MBLNO + "分票唛头不能为空";
}
else
{
if (StringIsChinese(OpBill.MARKS))
{
error = error + "<br />提单号:" + OpBill.MBLNO + "分票唛头含有中文或双字节字符";
}
else
{
error += formatlengthError("txt", OpBill.MARKS, 35, bill.MBLNO, "分票唛头", 0, "", false);
}
}
}
else
{
if (bill.MARKS == "")
{
error = error + "<br />提单号:" + bill.MBLNO + " 唛头不能为空";
}
else
{
if (StringIsChinese(bill.MARKS))
{
error = error + "<br />提单号:" + bill.MBLNO + " 唛头含有中文或双字节字符";
}
else
{
error += formatlengthError("txt", bill.MARKS, 35, bill.MBLNO, "唛头", 0, "", false);
}
}
}
if (isbill == 1)
{
if (OpBill.DESCRIPTION == "")
{
error = error + "<br />提单号:" + bill.MBLNO + " 分票货物描述不能为空";
}
else
{
if (StringIsChinese(OpBill.DESCRIPTION))
{
error = error + "<br />提单号:" + bill.MBLNO + " 分票货物描述含有中文或双字节字符";
}
else
{
//error += formatlengthError("txt", OpBill.DESCRIPTION, 35, bill.MBLNO, "分票货物描述", 0, "");
}
}
}
else
{
if (bill.DESCRIPTION == "")
{
error = error + "<br />提单号:" + bill.MBLNO + " 货物描述不能为空";
}
else
{
if (StringIsChinese(bill.DESCRIPTION))
{
error = error + "<br />提单号:" + bill.MBLNO + " 货物描述含有中文或双字节字符";
}
else
{
//error += formatlengthError("txt", bill.DESCRIPTION, 35, bill.MBLNO, "货物描述", 0, "");
}
}
}
if (carrier == "YML")
{
if (GetPortEDICode(bill.PORTLOADID, "YML") == "" || GetPortEDICode(bill.PORTLOADID, "YML").Length != 5)
{ error = error + "<br />提单号:" + bill.MBLNO + " 装货港代码不能为空或录入不正确(必须是5位代码)"; }
}
else
{
if (GetPortEDICode(bill.PORTLOADID, "PILMELL") == "" || GetPortEDICode(bill.PORTLOADID, "PILMELL").Length != 5)
{ error = error + "<br />提单号:" + bill.MBLNO + " 装货港代码不能为空或录入不正确(必须是5位代码)"; }
}
if (bill.PORTLOAD == null || bill.PORTLOAD == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 装货港不能为空"; }
if (bill.ETD == null || bill.ETD == "")
{
error = error + "<br />提单号:" + bill.MBLNO + " 开船日期不能为空";
return error;
}
if (carrier == "YML")
{
if (GetPortEDICode(bill.PORTDISCHARGEID, "YML") == "" || GetPortEDICode(bill.PORTDISCHARGEID, "YML").Length != 5)
{ error = error + "<br />提单号:" + bill.MBLNO + " 卸货港代码不能为空或录入不正确(必须是5位代码)"; }
}
else
{
if (GetPortEDICode(bill.PORTDISCHARGEID, "PILMELL") == "" || GetPortEDICode(bill.PORTDISCHARGEID, "PILMELL").Length != 5)
{ error = error + "<br />提单号:" + bill.MBLNO + " 卸货港代码不能为空或录入不正确(必须是5位代码)"; }
}
if (bill.PORTDISCHARGE == null || bill.PORTDISCHARGE == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 卸货港不能为空"; }
if (GetPortEDICode(bill.DESTINATIONID, "PILMELL") == "" || GetPortEDICode(bill.DESTINATIONID, "PILMELL").Length != 5)
{ error = error + "<br />提单号:" + bill.MBLNO + " 目的地代码不能为空或录入不正确(必须是5位代码)"; }
string sdkj = GetPackageEDICode(bill.KINDPKGS, "PILMELL").Trim();
if (isbill != 1)
{
if (carrier == "YML")
{
if (GetPackageEDICode(bill.KINDPKGS, "YML").Trim() == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 包装EDI代码不能为空"; }
}
else
{
if (GetPackageEDICode(bill.KINDPKGS, "PILMELL").Trim() == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 包装EDI代码不能为空"; }
}
}
else
{
if (carrier == "YML")
{
if (GetPackageEDICode(OpBill.KINDPKGS, "YML").Trim() == "")
{ error = error + "<br />提单号:" + OpBill.MBLNO + "分票包装EDI代码不能为空"; }
}
else
{
if (GetPackageEDICode(OpBill.KINDPKGS, "PILMELL").Trim() == "")
{ error = error + "<br />提单号:" + OpBill.MBLNO + "分票包装EDI代码不能为空"; }
}
}
if (isbill != 1)
{
if (Convert.ToDecimal(bill.PKGS) == 0)
{ error = error + "<br />提单号:" + bill.MBLNO + " 货物件数不能为空"; }
if (Convert.ToDecimal(bill.KGS) == 0)
{ error = error + "<br />提单号:" + bill.MBLNO + " 货物重量不能为空"; }
if (Convert.ToDecimal(bill.CBM) == 0)
{ error = error + "<br />提单号:" + bill.MBLNO + " 货物尺码不能为空"; }
}
else
{
if (OpBill.PKGS == 0)
{ error = error + "<br />提单号:" + bill.MBLNO + " 分票货物件数不能为空"; }
if (OpBill.KGS == 0)
{ error = error + "<br />提单号:" + bill.MBLNO + " 分票货物重量不能为空"; }
if (OpBill.CBM == 0)
{ error = error + "<br />提单号:" + bill.MBLNO + " 分票货物尺码不能为空"; }
}
if (carrier != "MCCQ" && carrier != "MAEU" && carrier != "SUDU" && carrier != "CMDU")
{
if (bill.HSCODE == null || bill.HSCODE == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " HS编码不能为空"; }
}
if (bill.CARGOID == null || bill.CARGOID == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 货物标示不能为空"; }
if (bill.CARGOID == "D")
{
if (bill.DCLASS == null || bill.DCLASS == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 危险品分类不能为空"; }
if (bill.DUNNO == null || bill.DUNNO == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 危险品编号不能为空"; }
}
if (bill.CARGOID == "R")
{
if (bill.TEMPSET == null || bill.TEMPSET == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 设置温度不能为空"; }
if (bill.REEFERF == null || bill.REEFERF == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 通风度不能为空"; }
}
if (bill.BLFRT.IndexOf("PREPAID") >= 0)
{
if (carrier == "YML")
{
if (bill.PREPARDATID == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 预付地点或预付地点EDI代码不能为空"; }
}
else
{
if ((bill.PREPARDATID == ""))
{ error = error + "<br />提单号:" + bill.MBLNO + " 预付地点或预付地点EDI代码不能为空"; }
}
}
if (bill.BLFRT.IndexOf("COLLECT") >= 0)
{
if (carrier == "YML")
{
if (GetPortEDICodeByEname(bill.PAYABLEAT, "YML") == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 到付地点或到付地点EDI代码不能为空"; }
}
else
{
if (bill.PAYABLEAT != "")
{
if (GetPortEDICodeByEname(bill.PAYABLEAT, "PILMELL") == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 到付地点或到付地点EDI代码不能为空"; }
}
}
}
if (filetype == "E")
{
if (carrier == "YML")
{
if (GetPortEDICode(bill.ISSUEPLACEID, "YML") == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 签单地点或到签单地点EDI代码不能为空"; }
}
else
{
if (GetPortEDICode(bill.ISSUEPLACEID, "PILMELL") == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 签单地点或到签单地点EDI代码不能为空"; }
}
}
if ((bill.SERVICE == null || bill.SERVICE == ""))
{ error = error + "<br />提单号:" + bill.MBLNO + " 运输条款不能为空"; }
//if (carrier != "MCCQ" && carrier != "MAEU" && carrier != "SUDU")
//{
//}
var bsno = "";
if (isbill != 1)
{
bsno = bill.BSNO;
}
else
{
bsno = OpBill.AS_ID;
}
var ctnlist = MsOpSeaeDAL.MsOpSeaeDAL.GetBodyList("BSNO='" + bsno + "'");
if (ctnlist.Count == 0) { error = error + "<br />提单号:" + bill.MBLNO + " 集装箱信息不能为空"; };
if (filetype == "E")
{
#region 集装箱判断检查
string sCtnCntrno = "";
int iCTN = 0;
int iCTNDetail = 0;
if (ctnlist.Count != 0)
{
Decimal dlPKGS = 0;
Decimal dlKGS = 0;
Decimal dlCBM = 0;
foreach (var ctn in ctnlist)
{
if (carrier == "YML")
{
if (GetCtnEDICode(ctn.CTNALL, "YML") == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 集装箱箱型EDI代码不能为空"; }
}
else
{
if (GetCtnEDICode(ctn.CTNALL, "PILMELL") == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 集装箱箱型EDI代码不能为空"; }
}
//if ((ctn.CTNALL.IndexOf("RH") > 0 || ctn.CTNALL.IndexOf("RF") > 0) && (bill.CARGOID != "R"))
//{
// { error = error + "<br />提单号:" + bill.MBLNO + " 集装箱箱型为冻柜,货类代码请选择冻柜"; }
//}
if (ctn.CNTRNO == null || ctn.CNTRNO == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 箱号不能为空"; }
if (ctn.SEALNO == null || ctn.SEALNO == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 封号不能为空"; }
if (billams.BYCOUNTRY == "BRAZIL")
{
if (ctn.TAREWEIGHT == 0)
{ error = error + "<br />提单号:" + bill.MBLNO + " 箱皮重不能为空"; }
}
if (ctn.KINDPKGS != bill.KINDPKGS)
{ error = error + "<br />提单号:" + bill.MBLNO + " 中的包装类型与集装箱的包装类型不同"; }
//是否有分箱
var OpCtnDetailList = MsOpSeaeDAL.MsOpSeaeDAL.GetOpCtnDetailList("[CTN_ID]='" + ctn.CTN_ID.ToString() + "'");
if (OpCtnDetailList.Count > 0)
{
iCTNDetail++;
}
else
{
sCtnCntrno += "、" + ctn.CNTRNO;
}
iCTN++;
//
dlPKGS += ctn.PKGS;
dlKGS += ctn.KGS;
dlCBM += ctn.CBM;
}
if (dlPKGS != Convert.ToInt32(bill.PKGS))
{ error = error + "<br />提单号:" + bill.MBLNO + " 集装箱件数合计数必须等于委托单总件数"; }
if (dlKGS != Convert.ToDecimal(bill.KGS))
{ error = error + "<br />提单号:" + bill.MBLNO + " 集装箱重量合计数必须等于委托单总重量数"; }
if (dlCBM != Convert.ToDecimal(bill.CBM))
{ error = error + "<br />提单号:" + bill.MBLNO + " 集装箱尺码合计数必须等于委托单总尺码数"; }
}
//有分箱
if (iCTNDetail > 0)
{
if (iCTNDetail != iCTN)
{
error = error + "<br />提单号:" + bill.MBLNO + "的“" + sCtnCntrno.Substring(1) + "”等箱号未添加分箱明细!";
}
var OpCtnDetailList = MsOpSeaeDAL.MsOpSeaeDAL.GetOpCtnDetailList("[CTN_ID] in (select [CTN_ID] from op_ctn where BSNO='" + bsno + "')");
foreach (var ctnDetail in OpCtnDetailList)
{
if (ctnDetail.KINDPKGS == null || ctnDetail.KINDPKGS == "")
{
if (error.IndexOf(ctnDetail.CNTRNO + "”箱号的分箱包装不能为空!") < 0)
{
error = error + "<br />提单号:" + bill.MBLNO + "的“" + ctnDetail.CNTRNO + "”箱号的分箱包装不能为空!";
}
}
else
{
if (GetPackageEDICode(ctnDetail.KINDPKGS, "PILMELL").Trim() == "") { error = error + "<br />提单号:" + bill.MBLNO + "的“" + ctnDetail.CNTRNO + "”箱号分箱包装EDI代码不能为空"; }
if (ctnDetail.KINDPKGS != bill.KINDPKGS)
{ error = error + "<br />提单号:" + bill.MBLNO + " 中的包装类型与集装箱的分箱包装类型不同"; }
}
if (ctnDetail.DESCRIPTION == null || ctnDetail.DESCRIPTION == "")
{
error += "<br />提单号:" + bill.MBLNO + "的“" + ctnDetail.CNTRNO + "”箱号的分箱货描不能为空!";
}
else
{
error += formatlengthError("txt", ctnDetail.DESCRIPTION, 70, bill.MBLNO, "的“" + ctnDetail.CNTRNO + "”箱号的分箱货物描述", 0, "", false);
}
}
//
string slSQL = "SELECT * from (SELECT c.CTN_ID,c.CNTRNO,c.PKGS,c.KGS,c.CBM,isnull(sum(d.PKGS),0) as PKGS_d,isnull(sum(d.KGS),0) as KGS_d,isnull(sum(d.CBM),0) as CBM_d from op_ctn as c INNER JOIN op_ctn_detail as d on c.CTN_ID=d.CTN_ID where c.BSNO='" + bsno + "' GROUP BY c.CTN_ID,c.CNTRNO,c.PKGS,c.KGS,c.CBM) as a where PKGS<>PKGS_d or KGS<>KGS_d or CBM<>CBM_d ";
DataSet dsOpCtnDetail = T_ALL_DA.GetAllSQL(slSQL);
if (dsOpCtnDetail != null)
{
if (dsOpCtnDetail.Tables[0].Rows.Count > 0)
{
for (int i = 0; i < dsOpCtnDetail.Tables[0].Rows.Count; i++)
{
error = error + "<br />提单号:" + bill.MBLNO + "的“" + dsOpCtnDetail.Tables[0].Rows[i]["CNTRNO"].ToString() + "”箱号的件(" + dsOpCtnDetail.Tables[0].Rows[i]["PKGS"].ToString() + ")、重(" + dsOpCtnDetail.Tables[0].Rows[i]["KGS"].ToString() + ")、尺(" + dsOpCtnDetail.Tables[0].Rows[i]["CBM"].ToString() + ")不等于其分箱件(" + dsOpCtnDetail.Tables[0].Rows[i]["PKGS_d"].ToString() + ")、重(" + dsOpCtnDetail.Tables[0].Rows[i]["KGS_d"].ToString() + ")、尺(" + dsOpCtnDetail.Tables[0].Rows[i]["CBM_d"].ToString() + ")的合计数!";
}
}
}
}
#endregion
if (bill.BYCOUNTRY == "USA")
{
if (bill.CONSIGNEEPOSTCODE == null || bill.CONSIGNEEPOSTCODE == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 收货人邮编不能为空"; }
if (bill.NOTIFYPARTYPOSTCODE == null || bill.NOTIFYPARTYPOSTCODE == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 通知人邮编不能为空"; }
}
else if (bill.BYCOUNTRY == "CANADA")
{
if (bill.CONSIGNEEPOSTCODE == null || bill.CONSIGNEEPOSTCODE == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 收货人邮编不能为空"; }
}
else if (bill.BYCOUNTRY == "BRAZIL")
{
if (bill.CONSIGNEECOUNTRY == null || bill.CONSIGNEECOUNTRY == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 收货人国家代码不能为空"; }
if (bill.CONSIGNEETAXNO == null || bill.CONSIGNEETAXNO == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 收货人税号不能为空"; }
if (bill.NOTIFYPARTYCOUNTRY == null || bill.NOTIFYPARTYCOUNTRY == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 通知人国家代码不能为空"; }
if (bill.NOTIFYPARTYTAXNO == null || bill.NOTIFYPARTYTAXNO == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 通知人税号不能为空"; }
if (bill.GOODSNCM == null || bill.GOODSNCM == "")
{ error = error + "<br />提单号:" + bill.MBLNO + " 货物NCM编码不能为空"; }
}
}
else
{
}
if (carrier == "YML")
{
if (string.IsNullOrEmpty(billams.SHIPPERCOUNTRY)) error = error + "<br />提单号:" + bill.MBLNO + " 发货人国家代码不能为空";
if (string.IsNullOrEmpty(billams.CONSIGNEECOUNTRY)) error = error + "<br />提单号:" + bill.MBLNO + " 收货人国家代码不能为空";
}
}
return error;
}
public static string CreateEdiPILMELL(EDIBaseModel InttrEdi)
{
string filename = path + "\\" + mblno + DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".txt";
if (System.IO.File.Exists(filename))
{
System.IO.File.Delete(filename);
}
FileStream f = new FileStream(filename, FileMode.Create);
StreamWriter r = new StreamWriter(f, Encoding.Default);
T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA();
var icount = 0;
var bsno = "";
var OpBill = new MsOpSeaeBill();
r.WriteLine("UNB+UNOB:1+" + ftpset.SENDCODE + "SO:ZZZ+" + ftpset.RECEIVECODE + ":ZZZ+" + DateTime.Now.ToString("yyMMdd:HHmm") + "+" + headData[0].CUSTNO + "'");
icount = icount + 1;
foreach (var bill in headData)
{
DataSet dsUserOp = T_ALL_DA.GetAllSQL("select top 1 * from [user] as u INNER JOIN user_baseinfo as b on u.GID=b.USERID where [SHOWNAME]='" + bill.OP.ToString() + "'");
//
bsno = bill.CUSTNO;
if (isbill == 1)
OpBill = MsOpSeaeDAL.MsOpSeaeDAL.GetBillData("BSNO='" + bill.BSNO + "'");
r.WriteLine("UNH+" + bill.CUSTNO + "+IFTMBF:D:99B:UN'");
icount = icount + 1;
if (isbill != 1)
{
if (filerole == "9")
r.WriteLine("BGM+335+" + bill.MBLNO + "+9'");
else
r.WriteLine("BGM+335+" + bill.MBLNO + "+5'");
}
else
{
if (filerole == "9")
r.WriteLine("BGM+335+" + OpBill.MBLNO + "+9'");
else
r.WriteLine("BGM+335+" + OpBill.MBLNO + "+5'");
}
r.WriteLine("DTM+137:" + DateTime.Now.ToString("yyyyMMddHHmm") + ":203'");
icount = icount + 2;
if (bill.SERVICE.ToUpper() == "DOOR-DOOR")
{
r.WriteLine("TSR+16+2'");
}
else if (bill.SERVICE.ToUpper() == "DOOR-CY")
{
r.WriteLine("TSR+15+2'");
}
else if (bill.SERVICE.ToUpper() == "CY-DOOR")
{
r.WriteLine("TSR+17+2'");
}
else if (bill.SERVICE.ToUpper() == "CFS-CFS")
{
r.WriteLine("TSR+14+2'");
}
else
{
r.WriteLine("TSR+11+2'");
}
var str_pay = "";
if (bill.BLFRT.IndexOf("PREPAID") >= 0)
str_pay = bill.PREPARDAT;
if (bill.BLFRT.IndexOf("COLLECT") >= 0)
str_pay = bill.PAYABLEAT;
//if (isbill != 1)
//{
// r.WriteLine("FTX+AAI+++" + bill.BLFRT + " Payable at " + str_pay + " " + bill.SERVICE + " "
// + bill.PKGS + bill.KINDPKGS + " " + formatEdiStr("txt", bill.EDIREMARK.Replace("\r\n", " ").Replace("\n", " ").Replace("\r", " ")) + "'");
//}
//else
//{
// r.WriteLine("FTX+AAI+++" + bill.BLFRT + " Payable at " + str_pay + " " + OpBill.SERVICE + " "
// + OpBill.PKGS + OpBill.KINDPKGS + " " + formatEdiStr("txt", bill.EDIREMARK.Replace("\r\n", " ").Replace("\n", " ").Replace("\r", " ")) + "'");
//}
//icount = icount + 2;
//if (isbill != 1)
// r.WriteLine("CNT+7:" + Math.Round(Convert.ToDecimal(bill.KGS), 3) + ":KGM'");//按照四舍五入的国际标准
//else
// r.WriteLine("CNT+7:" + Math.Round(OpBill.KGS, 3) + ":KGM'");
//if (isbill != 1)
// r.WriteLine("CNT+11:" + bill.PKGS + "'");
//else
// r.WriteLine("CNT+11:" + OpBill.PKGS + "'");
//if (isbill != 1)
// r.WriteLine("CNT+15:" + Math.Round(Convert.ToDecimal(bill.CBM), 3) + ":MTQ'");
//else
// r.WriteLine("CNT+15:" + Math.Round(OpBill.CBM, 3) + ":MTQ'");
//icount = icount + 3;
//if (bill.BLFRT == "FREIGHT COLLECT")
//{
// if (bill.PAYABLEAT != "")
// {
// r.WriteLine("LOC+57+" + GetPortEDICodeByEname(bill.PAYABLEAT, "INTTR") + "::6:" + bill.PAYABLEAT + "'");
// icount = icount + 1;
// }
//}
//else
//{
// r.WriteLine("LOC+57+" + GetPortEDICodeByEname(bill.PREPARDAT, "INTTR") + "::6:" + bill.PREPARDAT + "'");
// icount = icount + 1;
//}
r.WriteLine("LOC+88+" + GetPortEDICode(bill.PORTLOADID, "PILMELL") + ":139:6:" + bill.PORTLOAD + "'");
icount = icount + 1;
if (bill.DESTINATION != "")
{
r.WriteLine("LOC+7+" + GetPortEDICode(bill.DESTINATIONID, "PILMELL") + ":139:6:" + bill.DESTINATION + "'");
icount = icount + 1;
}
r.WriteLine("DTM+95:" + GetDateStr(bill.ISSUEDATE, "yyyyMMdd") + ":102'");
icount = icount + 1;
if (isbill != 1)
{
r.WriteLine("RFF+BN:" + bill.MBLNO + "'");
}
else
{
r.WriteLine("RFF+BN:" + OpBill.MBLNO + "'");
}
if (isbill != 1)
{
r.WriteLine("RFF+BM:" + bill.MBLNO + "'");
}
else
{
r.WriteLine("RFF+BM:" + OpBill.MBLNO + "'");
}
icount = icount + 2;
if (!string.IsNullOrEmpty(bill.CONTRACTNO))
{
r.WriteLine("RFF+CT:" + formatEdiStr("txt", bill.CONTRACTNO) + "'");
icount = icount + 1;
}
var voyno = "";
if (bill.VOYNO.IndexOf(".") >= 0)
voyno = bill.VOYNO.Substring(bill.VOYNO.IndexOf(".") + 1, bill.VOYNO.Length - bill.VOYNO.IndexOf(".") - 1);
else
voyno = bill.VOYNO;
r.WriteLine("TDT+20+" + voyno + "+1++MELL:172+++:::" + bill.VESSEL + "'");
r.WriteLine("LOC+9+" + GetPortEDICode(bill.PORTLOADID, "PILMELL") + ":139:6:" + bill.PORTLOAD + "'");
r.WriteLine("DTM+133:" + GetDateStr(bill.ETD, "yyyyMMdd") + ":102'");//yyyyMMddHHmm
r.WriteLine("LOC+11+" + GetPortEDICode(bill.PORTDISCHARGEID, "PILMELL") + ":139:6:" + bill.PORTDISCHARGE + "'");
icount = icount + 4;
var billams = GetAmsData("BSNO='" + bill.BSNO + "'");
var Shipping = "";
var DescriptionShipper = "";
if (isbill != 1)
{
if (billams.BYCOUNTRY != "")
Shipping = formatEdiStr("txt", billams.AMSSHIPPER);
else
Shipping = formatEdiStr("txt", bill.SHIPPER);
}
else Shipping = formatEdiStr("txt", OpBill.SHIPPER);
List<System.String> ShippingList = formatlengthStr(Shipping, 35);
if (ShippingList.Count != 0 && Shipping.Length > 0)
{
for (var i = 0; i < ShippingList.Count; i++)
{
if (i == 0) Shipping = "NAD+CZ+" + ftpset.SENDSUBCOMPANYCODE + "+" + ShippingList[0] + ":";
if (i == 1) Shipping = Shipping + ShippingList[i];
if (i == 2 || i == 3) Shipping = Shipping + ":" + ShippingList[i];
if (i >= 4 && ShippingList.Count > 5)
{
if (i == 4)
{
if (ShippingList[i].Length > 34)
{
Shipping = Shipping + ":" + ShippingList[i].Substring(0, 34);
DescriptionShipper = ShippingList[i].Substring(34);
}
else
Shipping = Shipping + ":" + ShippingList[i];
Shipping = Shipping + "*";
DescriptionShipper = "*" + DescriptionShipper;
}
else if (i > 4)
{
DescriptionShipper = DescriptionShipper + " " + ShippingList[i];
}
}
else
if (i == 4) Shipping = Shipping + ":" + ShippingList[i];
}
}
r.WriteLine(Shipping + "'");
icount = icount + 1;
if (isbill != 1)
{
if (billams.BYCOUNTRY != "")
Shipping = formatEdiStr("txt", billams.AMSCONSIGNEE);
else
Shipping = formatEdiStr("txt", bill.CONSIGNEE);
}
else Shipping = formatEdiStr("txt", OpBill.CONSIGNEE);
ShippingList = formatlengthStr(Shipping, 35);
var DescriptionConsignee = "";
if (ShippingList.Count != 0 && Shipping.Length > 0)
{
for (var i = 0; i < ShippingList.Count; i++)
{
if (i == 0) Shipping = "NAD+CN+" + ftpset.SENDSUBCOMPANYCODE + "+" + ShippingList[0] + ":";
if (i == 1) Shipping = Shipping + ShippingList[i];
if (i == 2 || i == 3) Shipping = Shipping + ":" + ShippingList[i];
if (i >= 4 && ShippingList.Count > 5)
{
if (i == 4)
{
if (ShippingList[i].Length > 33)
{
Shipping = Shipping + ":" + ShippingList[i].Substring(0, 33);
DescriptionConsignee = ShippingList[i].Substring(33);
}
else
Shipping = Shipping + ":" + ShippingList[i];
Shipping = Shipping + "**";
DescriptionConsignee = "**" + DescriptionConsignee;
}
else if (i > 4)
{
DescriptionConsignee = DescriptionConsignee + " " + ShippingList[i];
}
}
else
if (i == 4) Shipping = Shipping + ":" + ShippingList[i];
}
}
r.WriteLine(Shipping + "'");
icount = icount + 1;
if (isbill != 1)
{
if (billams.BYCOUNTRY != "")
Shipping = formatEdiStr("txt", billams.AMSNOTIFYPARTY);
else
Shipping = formatEdiStr("txt", bill.NOTIFYPARTY);
}
else Shipping = formatEdiStr("txt", OpBill.NOTIFYPARTY);
ShippingList = formatlengthStr(Shipping, 35);
var DescriptionNotifyparty = "";
if (ShippingList.Count != 0 && Shipping.Length > 0)
{
for (var i = 0; i < ShippingList.Count; i++)
{
if (i == 0) Shipping = "NAD+NI+" + ftpset.SENDSUBCOMPANYCODE + "+" + ShippingList[0] + ":";
if (i == 1) Shipping = Shipping + ShippingList[i];
if (i == 2 || i == 3) Shipping = Shipping + ":" + ShippingList[i];
if (i >= 4 && ShippingList.Count > 5)
{
if (i == 4)
{
if (ShippingList[i].Length > 32)
{
Shipping = Shipping + ":" + ShippingList[i].Substring(0, 32);
DescriptionNotifyparty = ShippingList[i].Substring(32);
}
else
Shipping = Shipping + ":" + ShippingList[i];
Shipping = Shipping + "***";
DescriptionNotifyparty = "***" + DescriptionNotifyparty;
}
else if (i > 4)
{
DescriptionNotifyparty = DescriptionNotifyparty + " " + ShippingList[i];
}
}
else
if (i == 4) Shipping = Shipping + ":" + ShippingList[i];
}
}
if (billams.BYCOUNTRY == "USA")
{
Shipping = Shipping + "+++" + billams.NOTIFYPARTYPOSTCODE;
r.WriteLine(Shipping + "'");
}
else if (billams.BYCOUNTRY == "BRAZIL")
{
if (billams.NOTIFYPARTYCOUNTRY != "")
Shipping = Shipping + "++++" + billams.NOTIFYPARTYCOUNTRY;
r.WriteLine(Shipping + "'");
if (billams.NOTIFYPARTYTAXNO != "")
{
r.WriteLine("RFF+GN:" + billams.NOTIFYPARTYTAXNO + "'");
icount = icount + 1;
}
}
else r.WriteLine(Shipping + "'");
icount = icount + 1;
r.WriteLine("NAD+BP+" + ftpset.ALIASSENDCODE + "+" + ftpset.SENDNAME + ":160:86+'");
icount = icount + 1;
r.WriteLine("NAD+AP+" + ftpset.SENDSUBCOMPANYCODE + "+" + ftpset.SENDNAME + ":160:86+'");
icount = icount + 1;
if (bill.BLFRT.IndexOf("PREPAID") >= 0)
r.WriteLine("CPI+4++P'");
else if (bill.BLFRT.IndexOf("COLLECT") >= 0)
r.WriteLine("CPI+4++C'");
else
r.WriteLine("CPI+4++B'");
icount = icount + 1;
if (isbill != 1)
{
r.WriteLine("GID+1+" + bill.PKGS.ToString() + ":" + GetPackageEDICode(bill.KINDPKGS, "PILMELL").Trim() + "::6:" + bill.KINDPKGS + "'");
}
else
{
r.WriteLine("GID+1+" + OpBill.PKGS.ToString() + ":" + GetPackageEDICode(OpBill.KINDPKGS, "PILMELL").Trim() + "::6:" + OpBill.KINDPKGS + "'");
}
icount = icount + 8;
if (bill.HSCODE != "")
{
r.WriteLine("PIA+5+" + bill.HSCODE + ":HS'");
icount = icount + 1;
}
if (isbill != 1)
{
Shipping = formatEdiStr("txt", bill.DESCRIPTION);
}
else Shipping = formatEdiStr("txt", OpBill.DESCRIPTION);
Shipping = Shipping.Replace("\n", "\\");
Shipping = Shipping.Replace("\r", " ");
string[] DescriptionList = Shipping.Split('\\');
if (DescriptionList.Length != 0)
{
for (var i = 0; i < DescriptionList.Length; i++)
{
if (i <= 1)
{
r.WriteLine("FTX+AAA+++" + DescriptionList[i] + "'");
icount = icount + 1;
}
}
}
//if (DescriptionShipper != "")
//{
// r.WriteLine("FTX+AAA+++" + DescriptionShipper + "'");
// icount = icount + 1;
//}
//if (DescriptionConsignee != "")
//{
// r.WriteLine("FTX+AAA+++" + DescriptionConsignee + "'");
// icount = icount + 1;
//}
//if (DescriptionNotifyparty != "")
//{
// r.WriteLine("FTX+AAA+++" + DescriptionNotifyparty + "'");
// icount = icount + 1;
//}
if (isbill != 1)
{
r.WriteLine("MEA+AAE+G+KGM:" + Math.Round(Convert.ToDecimal(bill.KGS), 3) + "'");
r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(Convert.ToDecimal(bill.CBM), 3) + "'");
}
else
{
r.WriteLine("MEA+AAE+G+KGM:" + Math.Round(OpBill.KGS, 3) + "'");
r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(OpBill.CBM, 3) + "'");
}
icount = icount + 2;
//if (isbill != 1)
//{
// Shipping = formatEdiStr("txt", bill.MARKS);
//}
//else Shipping = formatEdiStr("txt", OpBill.MARKS);
//Shipping = Shipping.Replace("\n", "\\");
//Shipping = Shipping.Replace("\r", " ");
//string[] MarksList = Shipping.Split('\\');
//if (MarksList.Length != 0)
//{
// for (var i = 0; i < MarksList.Length; i++)
// {
// r.WriteLine("PCI++" + MarksList[i] + "'");
// icount = icount + 1;
// }
//}
if (bill.CARGOID == "D")
{
r.WriteLine("DGS+IMD+" + bill.DCLASS + "+" + bill.DUNNO + "'");
r.WriteLine("CTA+HG+:" + billams.ATTN + "'");
r.WriteLine("COM+" + billams.ATTNTEL + ":TE'");
icount = icount + 3;
}
if (isbill != 1)
{
Shipping = bill.BSNO;
}
else Shipping = OpBill.AS_ID;
var ctnsumlist = GetCtnSum("BSNO='" + Shipping + "'");
foreach (var ctn in ctnsumlist)
{
if (ctn.CNTRSOURCE == "SOC")
r.WriteLine("EQD+CN++" + GetCtnEDICode(ctn.CTNALL, "PILMELL") + "+1'");
else
r.WriteLine("EQD+CN++" + GetCtnEDICode(ctn.CTNALL, "PILMELL") + "+2'");
r.WriteLine("EQN+" + ctn.CTNNUM.ToString() + "'");
icount = icount + 2;
if (bill.CARGOID == "R")
{
if (bill.REEFERF != "" && bill.REEFERF != "0")
r.WriteLine("MEA+AAE+AAS+CBM:" + bill.REEFERF + "'");
if (bill.HUMIDITY != "")
r.WriteLine("MEA+AAE+AAO+HMD:" + bill.HUMIDITY + "'");
r.WriteLine("TMP+2+" + bill.TEMPSET.Replace("+", "") + ":CEL'");
icount = icount + 2;
}
}
}
r.WriteLine("UNT+" + icount.ToString() + "+" + bsno + "'");
r.WriteLine("UNZ+" + headData.Count.ToString() + "+" + bsno + "'");
r.Close();
f.Close();
return filename;
}
*/
}
}