Exemple #1
0
        /// <summary>
        /// This method will call when user select withdrew from TermDeposit account.
        /// </summary>
        /// <param name="amount"></param>
        /// <returns> New Balance after withdraw</returns>
        public string withdraw(double amount)
        {
            this.Balance = this.Balance - amount;
            Activities transactionNew = new Activities()
            {
                info = $"$ WithDraw AMt : {amount}  at {DateTime.Now} balance is now ${this.Balance}."
            };

            this.addTransaction(transactionNew);

            return($"WithDraw AMt ${amount} from Account Number:  {this.accountNumber}. Your balance is now ${this.Balance}.");
        }
Exemple #2
0
        /// <summary>
        /// This method will deposited in Business account and return the message with new balance.
        /// </summary>
        /// <param name="amount"></param>
        /// <returns>new balance after deposit. </returns>
        public string deposit(double amount)
        {
            this.Balance = this.Balance + amount;
            Activities transactionNew = new Activities()
            {
                info = $"${amount} has been deposited at {DateTime.Now} balance is now ${this.Balance}."
            };

            this.addTransaction(transactionNew);


            return($"You have deposited:  $ {amount}  into account number {this.accountNumber}. Your balance is now ${this.Balance}.");
        }
Exemple #3
0
        /// <summary>
        /// This method is depositing the amount we passed and it will return the new balance.
        /// </summary>
        /// <param name="amount"></param>
        /// <returns>new balance of with deposited amt</returns>

        public string deposit(double amount)
        {
            this.Balance = this.Balance + amount;
            Activities transactionNew = new Activities()
            {
                info = $" \nDeposied Amount: ${amount} || Date:  {DateTime.Now} || Current Balance: $ {this.Balance}."
            };

            this.addTransaction(transactionNew);


            return($" \nDeposied Amount: ${amount} || Date:  {DateTime.Now} || Current Balance: $ {this.Balance}.");
        }
Exemple #4
0
        /// <summary>
        /// This method will call when user deposit in Term Account.
        /// </summary>
        /// <param name="amount"></param>
        /// <returns>newBalnce after deposit</returns>
        public string deposit(double amount)
        {
            //this will added back
            // this.Balance += amount;
            this.Balance = this.Balance + amount;
            Activities transactionNew = new Activities()
            {
                //passing as a info for dispaly.
                info = $"${amount} has been deposited at {DateTime.Now} balance is now ${this.Balance}."
            };

            this.addTransaction(transactionNew);

            //this message will be display.
            return($"You have deposited ${amount} into account number {this.accountNumber}. Your balance is now ${this.Balance}.");
        }
Exemple #5
0
        /// <summary>
        /// Implementing withdraw
        /// </summary>
        /// <param name="amount"></param>
        /// <returns>it will returns message of withdraw secuess and new balance. </returns>

        public string withdraw(double amount)
        {
            if (this.Balance > amount)
            {
                this.Balance = this.Balance - amount;
                Activities transactionNew = new Activities()
                {
                    info = $"$Withdraw Amt:  {amount}  || Date: {DateTime.Now} || Current Balance:  ${this.Balance}."
                };
                this.addTransaction(transactionNew);

                return($"Withdraw Amt: \t ${amount}|| Account Number: \t {this.accountNumber}. New Balance: \t ${this.Balance}.");
            }
            else
            {
                return($"You can not withdrawl ${amount} because you dont have sufficent funds. Your have $ {this.Balance} in you account.");
            }
        }
Exemple #6
0
        /// <summary>
        /// /it will returns message of withdraw sucess and new balance.
        /// There is limit of $ 5000 can be withdraw.
        /// </summary>
        /// <param name="amount"></param>
        /// <returns>new balnce </returns>
        public string withdraw(double amount)
        {
            if (this.Balance + 5000 > amount)//Hard coded 5000
            {
                //Cheecking this.Balance -=amount;
                this.Balance = this.Balance - amount;
                //This will be the new Activities Activites has info  will String get and set
                Activities transactionNew = new Activities()
                {
                    info = $"$ WithDraw AMt : {amount}  at {DateTime.Now} balance is now ${this.Balance}."
                };
                this.addTransaction(transactionNew);

                return($"WithDraw AMt ${amount} from Account Number:  {this.accountNumber}. Your balance is now ${this.Balance}."); return($"You withdrew ${amount} from account number {this.accountNumber}. Your balance is now ${this.Balance}. (Note: You have $5000 Credit Limits.)");
            }
            else
            {
                return($"You can not withdrawl ${amount} because you only have ${this.Balance} in you account.");
            }
        }
Exemple #7
0
        /// <summary>
        /// This method will calculate a interest based on date and return new balance message.
        /// </summary>
        /// <param name="date"></param>
        /// <returns>New Balnce with after interest added. </returns>
        public string intrest(DateTime date)
        {
            if (this.status == true)// Checking the status
            {
                date = DateTime.Now;
                double interestAmt = (this.Balance * (Validation.MonthDifference(date, this.dateAndTime)) * this.InterestRate);
                this.Balance = this.Balance + (this.Balance * (Validation.MonthDifference(DateTime.Now, this.dateAndTime) * 30) * (this.InterestRate / (365 * 100)));
                Activities transactionNew = new Activities()
                {
                    info = $" Your Accured ${interestAmt} has been added at {DateTime.Now} balance is now ${this.Balance} in your  {this.type} account. "
                };
                this.addTransaction(transactionNew);

                return($" Your Accured $ {interestAmt} has been added at {DateTime.Now} balance is now $ {this.Balance} in your  {this.type} account. ");
            }
            else
            {
                return($"There is no interest for Dormant account. ");
            }
        }
Exemple #8
0
        /// <summary>
        /// This method will call when user try to withdraw the amount from loan account.
        /// </summary>
        /// <param name="amount"></param>
        /// <returns>newBalance </returns>
        public string withdraw(double amount)
        {
            //The balance is in negative so. when we add negative negative the balance will of loan will be increase.
            if (this.Balance > amount)//Not necessary to chek because
            {
                this.Balance = this.Balance - amount;
                //
                Activities transactionNew = new Activities()
                {
                    info = $"$ WithDraw AMt : {amount}  at {DateTime.Now} balance is now ${this.Balance}."
                };
                this.addTransaction(transactionNew);

                return($"WithDraw AMt ${amount} from Account Number:  {this.accountNumber}. Your balance is now ${this.Balance}.");
            }
            else
            {
                return($" Unsufficent Fund: \n You can not withdrawl ${amount} because you only have ${this.Balance} in you account.");
            }
        }
Exemple #9
0
 /// <summary>
 /// This method will added the transaction in to transaction list.
 /// </summary>
 /// <param name="transactionNew"></param>
 public void addTransaction(Activities transactionNew)
 {
     this.transactionList.Add(transactionNew);
 }