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.
 
 
 

85 lines
2.6 KiB

namespace Win_in.Sfs.Scp.WebApi.Asns;
public static class ShipmentExtensions
{
public static Shipment SetHL(this Shipment shipment)
{
shipment.HL = new HL(HL.LevelType.S,"1","");
return shipment;
}
public static Shipment SetMEA_G(this Shipment shipment,decimal meaValue,string uom)
{
shipment.MEA_G = new MEA(MEA.MeaType.G, meaValue, uom);
return shipment;
}
public static Shipment SetMEA_N(this Shipment shipment,decimal meaValue,string uom)
{
shipment.MEA_N = new MEA(MEA.MeaType.N, meaValue, uom);
return shipment;
}
public static Shipment SetTD1(this Shipment shipment,string packagingCode,int loadingQty)
{
shipment.TD1 = new TD1(packagingCode, loadingQty);
return shipment;
}
public static Shipment SetTD5(this Shipment shipment,string routeSequenceCode,string identificationCode,string mode)
{
shipment.TD5 = new TD5(routeSequenceCode, identificationCode, mode);
return shipment;
}
public static Shipment SetTD3(this Shipment shipment,string equipmentCode,string equipmentNumber)
{
shipment.TD3 = new TD3(equipmentCode,equipmentNumber);
return shipment;
}
public static Shipment SetREF_BM(this Shipment shipment,string refValue)
{
shipment.REF_BM = new REF(REF.RefType.BM, refValue);
return shipment;
}
public static Shipment SetREF_PK(this Shipment shipment,string refValue)
{
shipment.REF_PK = new REF(REF.RefType.PK, refValue);
return shipment;
}
public static Shipment SetN1_SF(this Shipment shipment, string senderId)
{
shipment.N1_SF = new N1(N1.NameType.SF, senderId);
return shipment;
}
public static Shipment SetN1_ST(this Shipment shipment, string receiverId)
{
shipment.N1_ST = new N1(N1.NameType.ST, receiverId);
return shipment;
}
public static Shipment AddTare(this Shipment shipment,ShipNotice shipNotice, Tare tare)
{
tare.HL.HL01 = shipNotice.GetNextHl();
tare.HL.HL02 = shipment.HL.HL01;
shipment.Tares.Add(tare);
shipNotice.AddSegment(2);
return shipment;
}
public static Shipment AddOrphanItem(this Shipment shipment,ShipNotice shipNotice,Item orphanItem)
{
orphanItem.HL.HL01 = shipNotice.GetNextHl(orphanItem.SN1.Qty);
orphanItem.HL.HL02 = shipment.HL.HL01;
shipment.OrphanItems.Add(orphanItem);
// shipNotice.AddSegment(5+orphanItem.REF_LS_LTs.Count*2);
shipNotice.AddSegment(5);
return shipment;
}
}