コード例 #1
0
        public static SalesOrderHeader CreateNewOrder([ContributedAction(subMenu)] Customer customer,
                                                      [Optionally] bool copyHeaderFromLastOrder,
                                                      IFunctionalContainer container)
        {
            var newOrder = new SalesOrderHeader();

            newOrder.Customer = customer;

            if (copyHeaderFromLastOrder)
            {
                SalesOrderHeader last = QueryLastOrder(customer, container).FirstOrDefault();
                if (last != null)
                {
                    newOrder.BillingAddress  = last.BillingAddress;
                    newOrder.ShippingAddress = last.ShippingAddress;
                    newOrder.CreditCard      = last.CreditCard;
                    newOrder.ShipMethod      = last.ShipMethod;
                    newOrder.AccountNumber   = last.AccountNumber;
                }
            }
            else
            {
                newOrder.BillingAddress  = PersonRepository.AddressesFor(customer.BusinessEntity(), container, "Billing").FirstOrDefault();
                newOrder.ShippingAddress = PersonRepository.AddressesFor(customer.BusinessEntity(), container, "Shipping").FirstOrDefault();
            }
            return(newOrder);
        }
コード例 #2
0
 public List <Address> ChoicesBillingAddress()
 {
     return(PersonRepository.AddressesFor(Customer.BusinessEntity()).ToList());
 }
コード例 #3
0
 public List <Address> ChoicesBillingAddress(IFunctionalContainer container)
 {
     return(PersonRepository.AddressesFor(Customer.BusinessEntity(), container).ToList());
 }