Ejemplo n.º 1
0
        public Boolean FinalizeVendorOrder(VendorOrder order)
        {
            if (order == null)
            {
                throw new ApplicationException("VendorOrder cannot be null");
            }
            if (order.LineItems == null)
            {
                throw new ApplicationException("VendorOrder cannot have zero line items");
            }
            var oldOrder = new VendorOrder(order.Id, order.VendorID);

            oldOrder.Finalized         = order.Finalized;
            oldOrder.NumberOfShipments = order.NumberOfShipments;
            order.Finalized            = true;
            foreach (VendorOrderLineItem item in order.LineItems)
            {
                prodMan.AddToAvailable(item.QtyReceived, item.ProductID);
                prodMan.AddToOnHand(item.QtyDamaged + item.QtyReceived, item.ProductID);
                prodMan.RemoveFromOnOrder(item.QtyReceived + item.QtyDamaged, item.ProductID);
            }
            var result = VendorOrderDAL.Update(oldOrder, order, _connection);

            return(result);
        }
Ejemplo n.º 2
0
        }//End of UpdatePickedTrue(.)

        //When would this be done?
        public bool UpdatePickedFalse(ShippingOrder order)
        {
            foreach (ShippingOrderLineItem item in order.ShippingOrderLineItemList)
            {
                prodMan.AddToAvailable(item.Quantity, item.ProductId);
            }
            //Need to do error checking... Try/Catch.
            return(ShippingOrderDAL.UnpickShippingOrder(order, _connection));
        }//End of UpdatePickedFalse(.)