Exemple #1
0
 private Order(Customer customer)
     : this()
 {
     //_lineItems = new List<LineItem>();
       if (customer != null) {
     CustomerId = customer.Id;
     SetShippingAddress(customer.PrimaryAddress);
       }
       ApplyCustomerStatusDiscount(customer);
 }
Exemple #2
0
 public static Order CreateOrder(Customer customer)
 {
     return new Order(customer);
 }
Exemple #3
0
 public void ApplyCustomerStatusDiscount(Customer customer)
 {
     var status = CustomerStatus.New;
       if (customer != null)
     status = customer.Status;
       switch (status) {
     case CustomerStatus.Silver:
       CustomerDiscount = CustomerDiscounts.SilverDiscount;
       break;
     case CustomerStatus.Gold:
       CustomerDiscount = CustomerDiscounts.GoldDiscount;
       break;
     case CustomerStatus.Platinum:
       CustomerDiscount = CustomerDiscounts.PlatinumDiscount;
       break;
     default:
     {
       CustomerDiscount = 0;
       break;
     }
       }
 }
Exemple #4
0
 public static Customer CreateFromContact(Guid contactId, Address primaryAddress)
 {
     var customer = new Customer(contactId);
       customer.PrimaryAddress = primaryAddress;
       return customer;
 }