Example #1
0
 public Product(int id, string name, decimal price, CountryVatTax country, int quantity)
 {
     this.Id = id;
     this.Name = name;
     this.Price = price;
     this.PriceAfterTax = (decimal)country.VATTax * price;
     this.Quantity = quantity;
 }
Example #2
0
        public static void Main()
        {
            CountryVatTax Bulgaria = new CountryVatTax(1, 2.5, true);
            CountryVatTax Germany = new CountryVatTax(2, 3.5, true);
            CountryVatTax Russia = new CountryVatTax(3, 5.5, false);
            List<CountryVatTax> countryList = new List<CountryVatTax>();
            countryList.Add(Bulgaria);
            countryList.Add(Germany);
            countryList.Add(Russia);

            VATTaxCalculator calculator = new VATTaxCalculator(countryList);

            Console.WriteLine(calculator.CalculateTax(150));
            Console.WriteLine(calculator.CalculateTax(150, 3));
        }