예제 #1
0
 public Package(int ID, Order objOrder, Customer objCustInfo, OrderInfo objOrdInfo)
 {
     BaseOrder = objOrder;
     CustInfo = objCustInfo;
     PackageID = ID.ToString();
     PackageOrderNumber = objOrdInfo.OrderNumber;
     PackageSubOrderNumber = objOrdInfo.OrderItemId;
     ShipMethod = objOrdInfo.ShipMethod;
 }
예제 #2
0
 public void AddOrderNode(XmlNode pkgNode, OrderInfo ordInfo, int quantity)
 {
     // Layout of Order node: <Order OrderNum="" OrderID="" OrderItemID="" />
     try
     {
         // ReSharper disable PossibleNullReferenceException
         var ordersNode = pkgNode.SelectSingleNode("Orders");
         var orderNode = CreateNode(XmlNodeType.Element, null, "Order", null);
         orderNode.Attributes.Append(CreateAttributeWithValue("OrderNum", ordInfo.OrderNumber));
         orderNode.Attributes.Append(CreateAttributeWithValue("OrderID", ordInfo.OrderId.ToString()));
         orderNode.Attributes.Append(CreateAttributeWithValue("OrderItemID", ordInfo.OrderItemId.ToString()));
         orderNode.Attributes.Append(CreateAttributeWithValue("Qty", quantity.ToString()));
         ordersNode.AppendChild(orderNode);
         // ReSharper restore PossibleNullReferenceException
     }
     catch (Exception ex)
     {
         throw new XRefXmlException("Failed to add order node to XRefOrders2Packages.xml", ex);
     }
 }
예제 #3
0
        public XmlNode CreatePackageNode(int ID, OrderInfo objOrdInfo)
        {
            // Layout of Package node:   <Package ID="MDI00012345" Key="">
            //                                <Orders>
            //                                    <Order OrderNum="" OrderID="" OrderItemID="" />
            //                                </Orders>
            //                            </Package>

            var pkgID = "MDI" + ID.ToString().PadLeft(9, '0');

            try
            {

                // Construct the key for this package (this will correspond later with the key built
                // from the manifest lines).
                var key = String.Format("{0}_{1}", objOrdInfo.OrderNumber, objOrdInfo.OrderItemId);

                // ReSharper disable PossibleNullReferenceException
                var tempNode = CreateNode(XmlNodeType.Element, null, "Package", null);
                tempNode.Attributes.Append(CreateAttributeWithValue("ID", pkgID));
                tempNode.Attributes.Append(CreateAttributeWithValue("Key", key));

                // Create/append an Orders child node (this will contain the individual Order elements).
                tempNode.AppendChild(CreateNode(XmlNodeType.Element, null, "Orders", null));

                return tempNode;
                // ReSharper restore PossibleNullReferenceException
            }
            catch (Exception ex)
            {
                throw new XRefXmlException("Failed to create new package node for ID '" + pkgID + "'!", ex);
            }
        }
예제 #4
0
 public OrderItem(OrderInfo objOrdInfo,Product objItem, int quantity )
 {
     OrderInfo = objOrdInfo;
     Item = objItem;
     Quantity = quantity;
 }
예제 #5
0
 public OrderItem(OrderInfo objOrdInfo, Product objItem, int quantity)
 {
     OrderInfo = objOrdInfo;
     Item      = objItem;
     Quantity  = quantity;
 }