Ejemplo n.º 1
0
        public static void TermMature(string TermaccId, decimal ammount)
        {
            AccountStore.addAccountid('c');
            string   AccId       = AccountStore.lastmadeAccId;
            Checking newChecking = new Checking(AccId);

            AccountStore.addAccount(AccId, newChecking);
            AccountBalance.setBalance(AccId, ammount);
            AccountBalance.setBalance(TermaccId, 0);
            TransactionStore.AddTransferTransaction(AccId, null, 0, 0, ammount);
            TransactionStore.AddTransferTransaction(TermaccId, null, 3, 5, ammount);
            AccCreator.AccountCloser(TermaccId);
        }
        public static void Creator(int selection)
        {
            void StateCreated()
            {
                Console.WriteLine("\nAccount " + AccountStore.lastmadeAccId + " has been created!");
                AccountBalance.getBalance(AccountStore.lastmadeAccId);
            }

            switch (selection)
            {
            case 0:
                AccountStore.addAccountid('c');
                AccId = AccountStore.lastmadeAccId;
                Checking newChecking = new Checking(AccId);
                AccountStore.addAccount(AccId, newChecking);
                BalanceTransact.Deposit();
                AccountBalance.setBalance(AccId, BalanceTransact.checkedInput);
                StateCreated();
                TransactionStore.AddTransferTransaction(AccId, null, 0, 0, BalanceTransact.checkedInput);
                break;

            case 1:
                AccountStore.addAccountid('b');
                AccId = AccountStore.lastmadeAccId;
                Business newBusiness = new Business(AccId);
                AccountStore.addAccount(AccId, newBusiness);
                BalanceTransact.Deposit();
                AccountBalance.setBalance(AccId, BalanceTransact.checkedInput);
                StateCreated();
                TransactionStore.AddTransferTransaction(AccId, null, 1, 0, BalanceTransact.checkedInput);
                break;

            case 2:
                AccountStore.addAccountid('l');
                AccId = AccountStore.lastmadeAccId;
                AccCreator.setInterest();
                AccCreator.setInstallment();
                AccCreator.setInitialAmount();
                Loan newLoan = new Loan(AccId, AccCreator.InterestRate, AccCreator.InstallmentTypeId, AccCreator.InitialAmount);
                AccountStore.addAccount(AccId, newLoan);
                AccountBalance.setBalance(AccId, AccCreator.InitialAmount);
                StateCreated();
                TransactionStore.AddTransferTransaction(AccId, null, 2, 0, AccCreator.InitialAmount);
                break;

            case 3:
                AccountStore.addAccountid('t');
                AccId = AccountStore.lastmadeAccId;
                AccCreator.setInterest();
                AccCreator.setInitialAmount();
                TermDeposit newCD = new TermDeposit(AccId, InterestRate);
                AccountStore.addAccount(AccId, newCD);
                AccountBalance.setBalance(AccId, AccCreator.InitialAmount);
                StateCreated();
                TransactionStore.AddTransferTransaction(AccId, null, 3, 0, AccCreator.InitialAmount);
                break;

            default:
                Console.WriteLine("That is not a valid selection");
                return;
            }
        }