Beispiel #1
0
 public void Transferir(double valorTransferencia, conta contaDestino)
 {
     if (this.withdraw(valorTransferencia))
     {
         contaDestino.Depositar(valorTransferencia);
     }
 }
Beispiel #2
0
        private static void lsAccounts()
        {
            Console.WriteLine("List of all account in old bank:");

            if (listAccounts.Count == 0)
            {
                Console.WriteLine("No registered account");
                return;
            }
            for (int i = 0; i < listAccounts.Count; i++)
            {
                conta account = listAccounts[i];
                Console.Write($"#{i} - ");
                Console.WriteLine(account);
            }
        }
Beispiel #3
0
        private static void InsertAccount()
        {
            Console.WriteLine("Insert New Account: ");

            Console.Write("Type 1 for Conta Fisica or 2 for Juridica: ");
            int inputAccountKind = int.Parse(Console.ReadLine());

            Console.Write("Insert Client Name: ");
            string inputName = Console.ReadLine();

            Console.Write("Insert initial account money: ");
            double inputMoney = double.Parse(Console.ReadLine());

            Console.Write("Insert Desired Credit margin: ");
            double inputCredit = double.Parse(Console.ReadLine());

            conta newAccount = new conta(account: (TipoConta)inputAccountKind,
                                         saldo: inputMoney,
                                         credito: inputCredit,
                                         nome: inputName);

            listAccounts.Add(newAccount);
        }