Exemplo n.º 1
0
        private static void CalculateTotalsOfVatNumber(List <NormalVatNumber> normals, List <SimpleVatNumber> simples)
        {
            SelectedVat selected = SelectVat(normals, simples);

            if (selected.Normal != null)
            {
                CalculateAndPrint(selected.Normal);
            }
            else if (selected.Simple != null)
            {
                CalculateAndPrint(selected.Simple);
            }
            else
            {
                Console.WriteLine("The entered VAT number does not exist!");
            }
        }
Exemplo n.º 2
0
        private static void AddExpenseToVatNumber(List <NormalVatNumber> normals, List <SimpleVatNumber> simples)
        {
            SelectedVat selected = SelectVat(normals, simples);

            if (selected.Normal != null)
            {
                decimal newExpense = ReadDecimal("Enter the value of the expense: ");
                selected.Normal.Expenses.Add(newExpense);
            }
            else if (selected.Simple != null)
            {
                Console.WriteLine("You cannot add expenses to a VAT number of type 'simple'");
            }
            else
            {
                Console.WriteLine("The entered VAT number does not exist!");
            }
        }
Exemplo n.º 3
0
        private static void AddBillToVatNumber(List <NormalVatNumber> normals, List <SimpleVatNumber> simples)
        {
            SelectedVat selected = SelectVat(normals, simples);

            if (selected.Normal != null)
            {
                decimal newBill = ReadDecimal("Enter the value of the bill: ");
                selected.Normal.Bills.Add(newBill);
            }
            else if (selected.Simple != null)
            {
                decimal newBill = ReadDecimal("Enter the value of the bill: ");
                selected.Simple.Bills.Add(newBill);
            }
            else
            {
                Console.WriteLine("The entered VAT number does not exist!");
            }
        }