示例#1
0
        public void ProcessPurchase(int customerId, int goodId)
        {
            Customer c = Customer.FindCustomer(customerId);

            Order          o       = Stock.Find(goodId);
            CreditCardInfo cci     = c.GetCreditCardInfo();
            BankGateway    gateway = new BankGateway();

            gateway.ChargeCard(cci, o);


            c.AddToStatistics(o);
        }
示例#2
0
        void Purchase()
        {
            int      id = 123;
            Customer c  = Customer.FindCustomer(id);

            int            goodId  = 13457;
            Order          o       = Stock.Find(goodId);
            CreditCardInfo cci     = c.GetCreditCardInfo();
            BankGateway    gateway = new BankGateway();

            gateway.ChargeCard(cci, o);

            c.AddToStatistics(o);
        }