本文整理汇总了C#中Segment.GetElements方法的典型用法代码示例。如果您正苦于以下问题:C# Segment.GetElements方法的具体用法?C# Segment.GetElements怎么用?C# Segment.GetElements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Segment
的用法示例。
在下文中一共展示了Segment.GetElements方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessFooter
public static void ProcessFooter(Segment seg, IEdiMessage ediMessage, string ElementDelimiter,
int segmentsProcessed)
{
int expected = seg.GetElements(ElementDelimiter)[1].CastToInt();
if (segmentsProcessed != expected)
throw new InvalidEDIDocumentException("Segments processed does not match included segment count! Segments processed = " + segmentsProcessed + "; expected " + expected);
if (ediMessage.ControlNumber != seg.GetElements(ElementDelimiter)[2])
throw new InvalidEDIDocumentException("Control numbers in _header and _footer do not match!");
}
示例2: process_address_line
private static void process_address_line(Segment line, Address address, string elementDelimiter)
{
var arr = line.GetElements(elementDelimiter);
if (line.Label == SegmentLabel.AddressNameLabel)
{
address.AddressType = get_address_type(arr[1]);
address.AddressName = arr[2];
address.AddressCode = new AddressCode();
if (arr.Length >= 5)
{
address.AddressCode.CustomerCode = arr[4] ;
}
}
if (line.Label == SegmentLabel.AddressLineLabel)
if (string.IsNullOrEmpty(address.Address1))
address.Address1 = arr[1];
else
{
if (string.IsNullOrEmpty(address.Address2))
address.Address2 = arr[1];
}
if (line.Label == SegmentLabel.GeographicLabel)
{
address.City = arr[1];
address.State = arr[2];
address.Zip = arr[3];
if(arr.Length > 4)
address.Country = arr[4];
}
if (line.Label == SegmentLabel.ContactLabel)
{
address.ContactName = arr[2];
if (arr.Length > 3)
address.PhoneNumber = arr[4];
}
}
示例3: load_beginning_segment
// private void process_inner_ref(Segment rf, CustomerOrderLine line)
// {
// var arr = rf.GetElements(ElementDelimiter);
// }
private void load_beginning_segment(Segment segment, OrderRequestReceivedMessage orderRequestReceived)
{
var arr = segment.GetElements(ElementDelimiter);
if (arr[0] != SegmentLabel.POBegin.Text)
throw new Invalid850Exception("BEG Segment is missing!");
orderRequestReceived.CustomerPO = arr[3];
orderRequestReceived.RequestDate = DateTime.Now.ToString();
}
示例4: process_outer_ref
// private static void add_line_response_element(Segment seg, ICollection<LineResponseElementEntity> responseEls)
// {
// var elDelim = seg.Contents.Substring(3, 1);
// var arr = seg.GetElements(elDelim);
// responseEls.Add(new LineResponseElementEntity
// {
// ElementName = "REF02",
// Qualifier = arr[1],
// Value = arr[2]
// });
// }
private void process_outer_ref(Segment rf, string controlNumber, string elDelimiter, BusinessPartner partner)
{
var arr = rf.GetElements(elDelimiter);
assign_outer_reference(arr[1], arr[2], controlNumber, partner);
}
示例5: GetEls
private string[] GetEls(Segment lineSeg)
{
_elDelimiter = lineSeg.Contents.Substring(3, 1);
return lineSeg.GetElements(_elDelimiter);
}