コード例 #1
0
        public static void MakePayment(decimal amount, string customerName)
        {
            // Some validation or logic on the customer record
            var customer = CustomerSystem.GetCustomer(customerName);

            // Submit payment for processing
            PaymentSystem.MakePayment(amount, customer);
        }
コード例 #2
0
        public static void PurchaseItem(string customerName, string itemName, int quantity)
        {
            var item = InventorySystem.GetItem(itemName);

            var customer = CustomerSystem.GetCustomer(customerName);

            customer.ShoppingCart.Add(item, quantity);

            CustomerSystem.UpdateCustomer(customer);
        }