Exemple #1
0
        public static void _TakeOrder_33()
        {
            UserDao userDao = new UserDao();
            decimal price   = 88.5M;
            int     count   = 120;
            decimal total   = price * count;

            userDao.DecreaseBalance(1, total);
            userDao.IncreaseBalance(2, total);

            StockDao stockDao = new StockDao();

            stockDao.Decrease(2, count);
        }
Exemple #2
0
        public static void TakeOrder()
        {
            UserDao userDao = new UserDao();
            decimal price   = 88.5M;
            int     count   = 120;
            decimal total   = price * count;

            userDao.DecreaseBalance(1, total);
            userDao.IncreaseBalance(2, total);

            StockDao stockDao = new StockDao();

            stockDao.Decrease(2, count);
            //throw new Exception("stock is not enough.");
        }