贾荣国Home
3 years ago
24 changed files with 371 additions and 43 deletions
@ -0,0 +1,17 @@ |
|||||
|
using System; |
||||
|
|
||||
|
namespace Win_in.Sfs.Scp.WebApi.Asns; |
||||
|
|
||||
|
public static class ASN_X12_856_3060Extensions |
||||
|
{ |
||||
|
public static void SetISA(this ASN_X12_856_3060 asn,string asnCode,string senderId, string receiverId, DateTime datetime, ISA.EnvType envType = ISA.EnvType.P, |
||||
|
string authorization = " ", string security = " ") |
||||
|
{ |
||||
|
asn.ISA = new ISA(asnCode,senderId,receiverId,datetime,envType,authorization,security); |
||||
|
} |
||||
|
|
||||
|
public static void SetIEA(this ASN_X12_856_3060 asn,string asnCode) |
||||
|
{ |
||||
|
asn.IEA = new IEA(asnCode, asn.FunctionalGroups.Count); |
||||
|
} |
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
using System; |
||||
|
|
||||
|
namespace Win_in.Sfs.Scp.WebApi.Asns; |
||||
|
|
||||
|
public static class FunctionalGroupExtensions |
||||
|
{ |
||||
|
public static void SetGS(this FunctionalGroup functionalGroup,string senderId, string receiverId, DateTime datetime, string functionalGroupCode) |
||||
|
{ |
||||
|
functionalGroup.GS = new GS(senderId, receiverId, datetime, functionalGroupCode); |
||||
|
} |
||||
|
|
||||
|
public static void SetGE(this FunctionalGroup functionalGroup,string functionalGroupCode) |
||||
|
{ |
||||
|
functionalGroup.GE = new GE(functionalGroupCode, functionalGroup.TransactionSets.Count); |
||||
|
} |
||||
|
} |
@ -0,0 +1,36 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
|
||||
|
namespace Win_in.Sfs.Scp.WebApi.Asns; |
||||
|
|
||||
|
public static class HL_IExtentions |
||||
|
{ |
||||
|
public static void SetLIN(this HL_I hli, string itemCode) |
||||
|
{ |
||||
|
hli.LIN = new LIN(itemCode); |
||||
|
} |
||||
|
|
||||
|
public static void SetSN1(this HL_I hli, int qty, string uom, int accumQty) |
||||
|
{ |
||||
|
hli.SN1 = new SN1(qty, uom, accumQty); |
||||
|
} |
||||
|
|
||||
|
public static void SetPRF(this HL_I hli, string poNumber) |
||||
|
{ |
||||
|
hli.PRF = new PRF(poNumber); |
||||
|
} |
||||
|
|
||||
|
public static void SetPRF(this HL_I hli, int loadQty, int unitQty) |
||||
|
{ |
||||
|
hli.CLD = new CLD(loadQty, unitQty); |
||||
|
} |
||||
|
|
||||
|
public static void SetREF_LSs(this HL_I hli, List<string> itemLabelCodes) |
||||
|
{ |
||||
|
hli.REF_LSs = new List<REF>(); |
||||
|
foreach (var refLs in itemLabelCodes.Select(labelCode => new REF(REF.RefType.LS, labelCode))) |
||||
|
{ |
||||
|
hli.REF_LSs.Add(refLs); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,68 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.Runtime.CompilerServices; |
||||
|
using Microsoft.AspNetCore.SignalR; |
||||
|
|
||||
|
namespace Win_in.Sfs.Scp.WebApi.Asns; |
||||
|
|
||||
|
public static class HL_SExtensions |
||||
|
{ |
||||
|
public static void SetMEA_G(this HL_S hls,decimal meaValue,string uom) |
||||
|
{ |
||||
|
hls.MEA_G = new MEA(MEA.MeaType.G, meaValue, uom); |
||||
|
} |
||||
|
|
||||
|
public static void SetMEA_N(this HL_S hls,decimal meaValue,string uom) |
||||
|
{ |
||||
|
hls.MEA_N = new MEA(MEA.MeaType.N, meaValue, uom); |
||||
|
} |
||||
|
|
||||
|
public static void SetTD1(this HL_S hls,string packagingCode,int loadingQty) |
||||
|
{ |
||||
|
hls.TD1 = new TD1(packagingCode, loadingQty); |
||||
|
} |
||||
|
|
||||
|
public static void SetTD5(this HL_S hls,string routeSequenceCode,string identificationCode,string mode) |
||||
|
{ |
||||
|
hls.TD5 = new TD5(routeSequenceCode, identificationCode, mode); |
||||
|
} |
||||
|
|
||||
|
public static void SetTD3(this HL_S hls,string equipmentCode,string equipmentNumber) |
||||
|
{ |
||||
|
hls.TD3 = new TD3(equipmentCode,equipmentNumber); |
||||
|
} |
||||
|
|
||||
|
public static void SetREF_BM(this HL_S hls,string refValue) |
||||
|
{ |
||||
|
hls.REF_BM = new REF(REF.RefType.BM, refValue); |
||||
|
} |
||||
|
|
||||
|
public static void SetREF_PK(this HL_S hls,string refValue) |
||||
|
{ |
||||
|
hls.REF_PK = new REF(REF.RefType.PK, refValue); |
||||
|
} |
||||
|
|
||||
|
public static void SetN1_SF(this HL_S hls, string fromCode) |
||||
|
{ |
||||
|
hls.N1_SF = new N1(N1.NameType.SF, fromCode); |
||||
|
} |
||||
|
|
||||
|
public static void SetN1_ST(this HL_S hls, string toCode) |
||||
|
{ |
||||
|
hls.N1_ST = new N1(N1.NameType.ST, toCode); |
||||
|
} |
||||
|
|
||||
|
public static void CreateHL_T(this HL_S hls,ShipNotice shipNotice) |
||||
|
{ |
||||
|
var hlCode = shipNotice.AddHL(); |
||||
|
var hlt = new HL_T(hlCode.ToString(), hls.HL01); |
||||
|
hls.HL_Ts.Add(hlt); |
||||
|
} |
||||
|
|
||||
|
public static void CreateHL_I(this HL_S hls, ShipNotice shipNotice,int itemCount) |
||||
|
{ |
||||
|
var hlCode = shipNotice.AddHL(itemCount); |
||||
|
var hli = new HL_I(hlCode.ToString(), hls.HL01); |
||||
|
hls.HL_Is.Add(hli); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,19 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
|
||||
|
namespace Win_in.Sfs.Scp.WebApi.Asns; |
||||
|
|
||||
|
public static class HL_TExtensions |
||||
|
{ |
||||
|
public static void SetREF_LS(this HL_T hlt, string tareLabelCode) |
||||
|
{ |
||||
|
hlt.REF_LS = new REF(REF.RefType.LS, tareLabelCode); |
||||
|
} |
||||
|
|
||||
|
public static void CreateHL_I(this HL_T hlt, ShipNotice shipNotice,int itemCount) |
||||
|
{ |
||||
|
var hlCode = shipNotice.AddHL(itemCount); |
||||
|
var hli = new HL_I(hlCode.ToString(), hlt.HL01); |
||||
|
hlt.HL_Is.Add(hli); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
using System; |
||||
|
|
||||
|
namespace Win_in.Sfs.Scp.WebApi.Asns; |
||||
|
|
||||
|
public static class ShipNoticeExtensions |
||||
|
{ |
||||
|
public static void SetBSN(this ShipNotice shipNotice,string noticeNumber, DateTime datetime, string purpose = "00") |
||||
|
{ |
||||
|
shipNotice.BSN = new BSN(noticeNumber, datetime, purpose); |
||||
|
} |
||||
|
|
||||
|
public static void SetDTM(this ShipNotice shipNotice, DateTime dateTime,string datetimeType) |
||||
|
{ |
||||
|
shipNotice.DTM = new DTM(dateTime, datetimeType); |
||||
|
} |
||||
|
|
||||
|
public static void CreateHL_S(this ShipNotice shipNotice) |
||||
|
{ |
||||
|
var hlCode = shipNotice.AddHL(); |
||||
|
shipNotice.HL_S = new HL_S(hlCode.ToString()); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
namespace Win_in.Sfs.Scp.WebApi.Asns; |
||||
|
|
||||
|
public static class TransactionSetExtensions |
||||
|
{ |
||||
|
public static void SetST(this TransactionSet transactionSet,string transactionCode) |
||||
|
{ |
||||
|
transactionSet.ST = new ST(transactionCode); |
||||
|
} |
||||
|
|
||||
|
public static void SetSE(this TransactionSet transactionSet, string transactionCode) |
||||
|
{ |
||||
|
transactionSet.SE = new SE(transactionCode, transactionSet.ShipNotices.Count); |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue