コード例 #1
0
 private void Begin()
 {
     MessageLogger.ShowProgramName();
     AskCustomerInformation();
     MessageLogger.ShowPromotion();
     MessageLogger.AskForContinue();
 }
コード例 #2
0
        private void During()
        {
            do
            {
                SelectProduct();
                MessageLogger.ShowProductOnShoppingBag(_shoppingBag.GetProductList());
                MessageLogger.AskForContinue();

                if (MessageLogger.AskSelectActivityNumber() == 2)
                {
                    break;
                }
            } while (true);
        }
コード例 #3
0
        private void SelectProduct()
        {
            MessageLogger.ShowSelectProductNumber();
            int selectProductNumber = MessageLogger.AskSelectProductNumber();

            switch (selectProductNumber)
            {
            case 1:
                _product = ShoppingFactory.GetProduct(ProductName.Snack, 100);
                break;

            case 2:
                _product = ShoppingFactory.GetProduct(ProductName.Book, 239);
                break;

            case 3:
                _product = ShoppingFactory.GetProduct(ProductName.Furniture, 299);
                break;

            case 4:
                _product = ShoppingFactory.GetProduct(ProductName.KitchenEquipment, 259);
                break;

            case 5:
                _product = ShoppingFactory.GetProduct(ProductName.Medicine, 200);
                break;

            default:
                break;
            }

            int quantity = MessageLogger.AskProductQuantity(_product.Name.ToString());

            for (int i = 0; i < quantity; i++)
            {
                _shoppingBag.AddProduct(_product);
            }
        }
コード例 #4
0
 private void End()
 {
     MessageLogger.ShowReceipt(_customer, _shoppingBag);
     MessageLogger.ShowThankYou();
 }
コード例 #5
0
 private void AskCustomerInformation()
 {
     _customer.Name = MessageLogger.AskName();
     _customer.Age  = MessageLogger.AskAge();
 }