public CustomerOrderLine CreateLine(Segment line_seg) { if (line_seg.Label != "PO1") { return(null); } SegmentCount++; string el_delimiter = line_seg.Contents.Substring(3, 1); List <string> arr = line_seg.GetElements(el_delimiter); var line = new CustomerOrderLine { LineNumber = arr[1].CastToInt(), RequestedQuantity = arr[2].CastToInt(), RequestedPrice = arr[4].CastToDouble() }; for (int i = 6; i < arr.Count - 1; i++) { if (arr[i] == "IN") { line.CustomerPartNumber = arr[i + 1]; } if (arr[i] == "PD") { line.ItemDescription = arr[i + 1]; } if (arr[i] == "VN") { line.ItemID = arr[i + 1]; } } return(line); }
private static void process_address_line(Segment line, Address address, string elementDelimeter) { List <string> arr = line.GetElements(elementDelimeter); if (line.Label == EDIConstants.AddressNameLabel) { address.AddressType = get_address_type(arr[1]); address.AddressName = arr[2]; if (arr.Count >= 4) { address.AddressCode = arr[3]; } } if (line.Label == EDIConstants.AddressLineLabel) { if (string.IsNullOrEmpty(address.Address1)) { address.Address1 = arr[1]; } else { if (string.IsNullOrEmpty(address.Address2)) { address.Address2 = arr[1]; } } } if (line.Label == EDIConstants.GeographicLabel) { address.City = arr[1]; address.State = arr[2]; address.Zip = arr[3]; } }
private static void process_address_line(Segment line, Address address, string elementDelimeter) { List<string> arr = line.GetElements(elementDelimeter); if (line.Label == EDIConstants.AddressNameLabel) { address.AddressType = get_address_type(arr[1]); address.AddressName = arr[2]; if (arr.Count >= 4) address.AddressCode = arr[3]; } if (line.Label == EDIConstants.AddressLineLabel) if (string.IsNullOrEmpty(address.Address1)) address.Address1 = arr[1]; else { if (string.IsNullOrEmpty(address.Address2)) address.Address2 = arr[1]; } if (line.Label == EDIConstants.GeographicLabel) { address.City = arr[1]; address.State = arr[2]; address.Zip = arr[3]; } }
private ReceiptAcknowledgementMsg getAck(Segment segment ) { var els = segment.GetElements(_elementDelimiter); var ack = new ReceiptAcknowledgementMsg(); ack.ControlNumber = els[2]; ack.DocumentId = els[1].CastToInt(); return ack; }
private ReceiptAcknowledgementMsg getAck(Segment segment) { var els = segment.GetElements(_elementDelimiter); var ack = new ReceiptAcknowledgementMsg(); ack.ControlNumber = els[2]; ack.DocumentId = els[1].CastToInt(); return(ack); }
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]; } } }
public CustomerOrderLine CreateLine(Segment line_seg) { if (line_seg.Label != "PO1") return null; SegmentCount++; string el_delimiter = line_seg.Contents.Substring(3, 1); List<string> arr = line_seg.GetElements(el_delimiter); var line = new CustomerOrderLine { LineNumber = arr[1].CastToInt(), RequestedQuantity = arr[2].CastToInt(), RequestedPrice = arr[4].CastToDouble() }; for (int i = 6; i < arr.Count - 1; i++) { if (arr[i] == "IN") line.CustomerPartNumber = arr[i + 1]; if (arr[i] == "PD") line.ItemDescription = arr[i + 1]; if (arr[i] == "VN") line.ItemID = arr[i + 1]; } return line; }
private string[] GetEls(Segment lineSeg) { _elDelimiter = lineSeg.Contents.Substring(3, 1); return(lineSeg.GetElements(_elDelimiter)); }
// 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); }