private static void Main(string[] args)
        {
            Debug.WriteLine("Abstraction Example");
            Debug.WriteLine("");

            var orderInfo = new OrderInfo
            {
                CustomerName = "Claudia Almeida",
                Email        = "*****@*****.**",
                Product      = "LCD Monitor Smart Samsung",
                Price        = 259.00f,
                CreditCard   = "1234.5678.9876.5432"
            };

            Debug.WriteLine("Production");
            Debug.WriteLine("");

            var commerce = new Commerce();

            commerce.ProcessOrder(orderInfo);

            Console.WriteLine("");
            Console.WriteLine("Press [Enter] to exit...");
            Console.WriteLine("");
        }
Exemple #2
0
        static void Main(string[] args)
        {
            var orderInfo = new OrderInfo
            {
                CustomerName = "Rachid Lamtabbet",
                CreditCard   = "12457845125464721",
                Price        = 119.99,
                Product      = "Kindel WhitePaper 2"
            };

            var commerce = new Commerce(new BillingProcessor(),
                                        new Customer(),
                                        new Notifier(),
                                        new Logger());

            commerce.ProcessOrder(orderInfo);

            Console.Read();
        }
Exemple #3
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();
        }
Exemple #4
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();
        }
Exemple #5
0
        static void Main(string[] args)
        {
            var orderInfo = new OrderInfo
            {
                CustomerName = "Prasad Honrao",
                Email        = "*****@*****.**",
                Product      = "iPad",
                Price        = 499,
                CreditCard   = 123456
            };

            var commerce = new Commerce(new BillingProcessor(),
                                        new CustomerProcessor(),
                                        new Notifier(),
                                        new Logger());

            commerce.ProcessOrder(orderInfo);

            Console.WriteLine("Order processed successfully");

            Console.ReadLine();
        }