Exemplo n.º 1
0
        public static void writeToFileInsertTest(string coustomerId, string accountNumber)
        {
            SalaryAccount a  = new SalaryAccount();
            TextWriter    sw = new StreamWriter($"D:\\OneDrive\\school\\10. programmering avancerad - objektorienterad\\coding\\BankApp\\Data\\{coustomerId}\\accounts\\{accountNumber}.txt");

            sw.WriteLine($"{a.accountNumber}");
            sw.WriteLine($"{a.type}");
            sw.WriteLine($"{a.balance}");
            sw.WriteLine($"{a.cardNumber}");
            sw.WriteLine($"{a.cvv}");
            sw.WriteLine($"{a.credit}");
            sw.WriteLine($"{a.maxCredit}");
            sw.WriteLine($"{a.coustomerId}");
            sw.Close();
        }
Exemplo n.º 2
0
        private void AbstractClassExample()
        {
            Console.WriteLine("-- Abstract Class --");
            AbstractAccountBase defualtSavingAccount = new SavingAccount("SAVING0001", 10000);

            defualtSavingAccount.DisplayAmount();
            defualtSavingAccount.LoanApproval();

            AbstractAccountBase savingAccount = new SavingAccount("SAVING0002", 56000, 5);

            savingAccount.DisplayAmount();
            savingAccount.LoanApproval();

            SalaryAccount.TriggerForStaticConstructor = "Get out!";
            AbstractAccountBase salaryAccount = new SalaryAccount("SALARY0001", 25000, 3);

            salaryAccount.DisplayAmount();
            salaryAccount.LoanApproval();
        }