示例#1
0
 public void ProcessOrder(OrderInfo orderInfo)
 {
     _BillingProcessor.ProcessPayment(orderInfo.CustomerName, orderInfo.CreditCard, orderInfo.Price);
     _Logger.Log("Billing processed");
     _Customer.UpdateCustomerOrder(orderInfo.CustomerName, orderInfo.Product);
     _Logger.Log("Customer updated");
     _Notifier.SendReceipt(orderInfo);
     _Logger.Log("Receipt sent");
 }
示例#2
0
        static void Main(string[] args)
        {
            Console.WriteLine("COUPLED Example");
            Console.WriteLine();

            OrderInfo orderInfo = new OrderInfo()
            {
                CustomerName = "Miguel Castro",
                Email = "*****@*****.**",
                Product = "Laptop",
                Price = 1200,
                CreditCard = "1234567890"
            };

            Commerce commerce = new Commerce();

            commerce.ProcessOrder(orderInfo);

            Console.WriteLine();
            Console.WriteLine("Press [Enter] to exit...");
            Console.ReadLine();
        }
示例#3
0
 public void SendReceipt(OrderInfo orderInfo)
 {
     // send email to customer with receipt
     Console.WriteLine(string.Format("Receipt sent to customer '{0}' via email.", orderInfo.CustomerName));
 }