示例#1
0
        public SavingAccount CreateSavingAccount(string firstName, string lastName, long pesel)
        {
            int           id      = generateId();
            SavingAccount account = new SavingAccount(id, firstName, lastName, pesel);

            _accounts.Add(account);

            return(account);
        }
示例#2
0
        static void Main(string[] args)
        {
            SavingAccount objSaving = new SavingAccount();

            if (objSaving.AcceptDetails())
            {
                objSaving.Display();
            }
            else
            {
                return;
            }
        }
示例#3
0
        static void Main(string[] args)
        {
            SavingAccount saving = new SavingAccount("12345678");

            Console.WriteLine($"Account Number : {saving.AccountNo}");
            Console.WriteLine($"Current Saving Balance : {saving.CheckBalance()}");

            saving.Deposite(300M);
            Console.WriteLine($"Current Saving Balance : {saving.CheckBalance()}");

            saving.Withdrawals(200M);
            Console.WriteLine($"Current Saving Balance : {saving.CheckBalance()}");
        }
示例#4
0
        static void Main(string[] args)
        {
            SavingAccount a = new SavingAccount("Meher", 100.00, 100005);

            Console.WriteLine("Saving Account");
            a.AddBalance(100);
            a.Interest();
            a.Withdraw(50.0);
            a.ShowBalance();

            CheckingAccount b = new CheckingAccount("Hridoy", 250.0, 500010);

            Console.WriteLine("Checking Account");
            b.AddBalance(600.0);
            b.OrderCheck();
            b.Withdraw(100.0);
            b.ShowBalance();
        }
示例#5
0
        private void MakeAccount()
        {
            foreach (var c in customerList.Customers)
            {
                if (comboCustomers.SelectedItem.Equals(c.GetFullName()))
                {
                    if ((rbtnC.IsChecked == true) && (boxCredit.Text != ""))
                    {
                        int banknumber = c.AccountNumber();
                        checkingAccount = new CheckingAccount(int.Parse(boxCredit.Text));
                        c.AddBankAccount(checkingAccount);
                        checkingAccount.AddAccountNumber(banknumber);

                        MessageBox.Show("Du har skapat ett lönekonto!");
                    }

                    if (rbtnR.IsChecked == true)
                    {
                        int banknumber = c.AccountNumber();
                        retirementAccount = new RetirementAccount();
                        c.AddBankAccount(retirementAccount);
                        retirementAccount.AddAccountNumber(banknumber);

                        MessageBox.Show("Du har skapat ett pensionsspar!");
                    }
                    if (rbtnS.IsChecked == true)
                    {
                        int banknumber = c.AccountNumber();
                        savingAccount = new SavingAccount();
                        c.AddBankAccount(savingAccount);
                        savingAccount.AddAccountNumber(banknumber);

                        MessageBox.Show("Du har skapat ett sparkonto!");
                    }
                }
            }
        }
示例#6
0
        static void Main(string[] args)
        {
            string name   = "Bank accounts support.";
            string author = "Author: Dominik S.";

            Console.WriteLine(name);
            Console.WriteLine(author);
            Console.WriteLine();

            Account savacc  = new SavingAccount(7, "Dominik", "Sm.", 01234567890);
            Account savacc2 = new SavingAccount(13, "Ewelina", "O.", 09876543210);
            Account bilacc  = new BillingAccount(20, savacc.FirstName, savacc.LastName, savacc.Pesel);

            string fullName  = savacc.GetFullName2();
            string fullName2 = savacc2.GetFullName2();
            string fullName3 = bilacc.GetFullName2();
            string balance   = savacc.GetBalance();
            string balance2  = savacc2.GetBalance();
            string balance3  = bilacc.GetBalance();

            Console.WriteLine("Właścicel pierwszego konta oszczędnościowego: {0}", fullName);
            Console.WriteLine(balance);
            Console.WriteLine("Właściciel drugiego konta oszczędnościowego: {0}", fullName2);
            Console.WriteLine(balance2);
            Console.WriteLine("Właściciel pierwszego konta rozliczeniowego: {0}", fullName3);
            Console.WriteLine(balance3);
            Console.WriteLine();

            Printer printer = new Printer();

            printer.Print(savacc);
            printer.Print(savacc2);
            printer.Print(bilacc);

            Console.ReadKey();
        }