예제 #1
0
 public CustomerOrderLine CreateLine(Segment lineSeg)
 {
     if (lineSeg.Label == SegmentLabel.PurchaseOrderChange)
         return createChangeLine(lineSeg);
     if (lineSeg.Label != SegmentLabel.PurchaseOrder) return null;
     SegmentCount++;
     string[] arr = GetEls(lineSeg);
     var line = new CustomerOrderLine
                    {
                        LineNumber = arr[1].CastToInt(),
                        RequestedQuantity = arr[2].CastToInt(),
                        RequestedPrice = arr[4].CastToDecimal()
                    };
     for (int i = 6; i < arr.Length - 1; i++)
     {
         if (arr[i] == "IN" || arr[i] == "BP")
         {
             line.CustomerPartNumber = arr[i + 1];
         }
         if (arr[i] == "PD")
             line.ItemDescription = arr[i + 1];
         if (arr[i] == "VN" || arr[i] == "VP")
             line.ItemId = arr[i + 1];
     }
     return line;
 }
 private AcknowledgedOrderLine get_new_line(CustomerOrderLine i)
 {
     return new AcknowledgedOrderLine()
                {
                    ActualPrice = i.RequestedPrice,
                    ActualQuantity = i.RequestedQuantity,
                    LineNumber = i.LineNumber.ToString(),
                    CustomerPartNumber = i.CustomerPartNumber
                };
 }
예제 #3
0
        public void Add(CustomerOrderLine line)
        {
            line.CustomerIDs = CustomerIDs;
            line.CustomerPO  = CustomerPO;

            if (LineItems == null)
            {
                LineItems = new List <CustomerOrderLine>();
            }
            LineItems.Add(line);
        }
예제 #4
0
 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;
 }
        public void Add(CustomerOrderLine line)
        {
            line.CustomerIDs = CustomerIDs;
            line.CustomerPO = CustomerPO;

            if (LineItems == null)
                LineItems = new List<CustomerOrderLine>();
            LineItems.Add(line);
        }