AddOrder() public method

public AddOrder ( Order order ) : void
order Order
return void
        private static Customer GetCustomerGraph()
        {
            var product = new Product {Price = 10m};

            var order = new Order
                            {
                                Status = OrderStatus.Shipped,
                                ShipDate = new DateTime(2010, 1, 2)
                            };

            order.AddOrderLine(2, product);

            var order1 = new Order
                         	{
                         		Status = OrderStatus.Shipped,
                         		ShipDate = new DateTime(2010, 1, 1)
                         	};

            order1.AddOrderLine(3, product);

            var customer = new Customer
                           	{
                           		Status = CustomerStatus.Normal,
                           		Name = new Name {First = "Joe", Last = "Smith"}
                           	};

            customer.AddOrder(order);
            customer.AddOrder(order1);

            return customer;
        }
Beispiel #2
0
 public Order(Customer customer)
 {
     Status = OrderStatus.Draft;
     Customer = customer;
     customer.AddOrder(this);
 }