Пример #1
0
        /// <summary>
        /// Main Method.
        /// </summary>
        public static void Main()
        {
            // Add CountryVatTax countries - id, vat, isDefault
            CountryVatTax bg = new CountryVatTax(1, 20, true);

            // Add countries to list
            List<CountryVatTax> countriesList = new List<CountryVatTax>() { bg };

            // Initialise VatTaxCalculator with the countries list
            VatTaxCalculator calc = new VatTaxCalculator(countriesList);

            // Add products - id, name, quantity, price, country
            Product prod1 = new Product(0, "prod", 5, 10, bg);

            // Add products to list
            List<Product> productsList = new List<Product>() { prod1 };

            // Initialise a new Inventory with the products list
            ShopInventory newInventory = new ShopInventory(productsList);

            // Add product id and quantity to orderdict
            Dictionary<int, int> orderdict = new Dictionary<int, int> { { 0, 2 } };

            Order newOrder = new Order(orderdict);
        }
Пример #2
0
        static void Main(string[] args)
        {
            CountryVatTax obj = new CountryVatTax(1, 20, false);
            CountryVatTax obj1 = new CountryVatTax(2, 10, true);
            List<CountryVatTax> countries = new List<CountryVatTax>() { obj, obj1 };
            Calculator calcObj = new Calculator(countries);
            calcObj.Calc(5);
            calcObj.Calc(5, 1);

            Product product = new Product(5, 1, "Хак", 5, 1, countries);
            Product product2 = new Product(10, 1, "България", 5, 2, countries);
            ShopInventory newShopInvertory = new ShopInventory(product);
            Console.WriteLine("If all products of that type are sold out, the profil you will gain is = {0}", newShopInvertory.Audit());

            Order firstOrder = new Order(1, 3);
            newShopInvertory.RequestOrder(firstOrder);
        }
Пример #3
0
        static void Main(string[] args)
        {
            CountryVatTax        obj       = new CountryVatTax(1, 20, false);
            CountryVatTax        obj1      = new CountryVatTax(2, 10, true);
            List <CountryVatTax> countries = new List <CountryVatTax>()
            {
                obj, obj1
            };
            Calculator calcObj = new Calculator(countries);

            calcObj.Calc(5);
            calcObj.Calc(5, 1);

            Product       product          = new Product(5, 1, "Хак", 5, 1, countries);
            Product       product2         = new Product(10, 1, "България", 5, 2, countries);
            ShopInventory newShopInvertory = new ShopInventory(product);

            Console.WriteLine("If all products of that type are sold out, the profil you will gain is = {0}", newShopInvertory.Audit());

            Order firstOrder = new Order(1, 3);

            newShopInvertory.RequestOrder(firstOrder);
        }