コード例 #1
0
        public static void HandleDeposit()
        {
            if (accountbl.GetAllAccountsWithoutLoan(customer.CustomerId).Count != 0)
            {
                DisplayAcocuntWithoutLoan();
                Console.WriteLine("Enter Account number for deposit");
                int      accountno = Convert.ToInt32(Console.ReadLine());
                IAccount acc       = accountbl.GetAccount(accountno);

                if (accountbl.AcccountIsFound(accountno))
                {
                    Console.WriteLine("Enter Amount you want to deposit");
                    decimal amount = Convert.ToDecimal(Console.ReadLine());

                    if (amount > 0)
                    {
                        accountbl.Deposit(acc, amount);
                    }
                    else if (amount.Equals(0))
                    {
                        Console.WriteLine("Input 0 amount is not valid");
                    }
                    else
                    {
                        Console.WriteLine("Failed!! Negative amount");
                    }
                }//end if (accountbl.AcccountIsFound(accountno))


                else
                {
                    Console.WriteLine("Account is not found in the database");
                }
            }//end if (CheckingAndBusinessAccountsExisted())

            else
            {
                Console.WriteLine("No exisiting checking or business accounts");
            }
        }