private decimal interest; // interest rate in %

        #endregion Fields

        #region Constructors

        // default interestRate is 5% per year (0.416% per month) and the default balance is 100.0
        public Account(Customer holder, decimal interest = 0.416m, decimal balance = 100.0m)
        {
            this.Holder = holder;
            this.InterestRatePerMonth = interest;
            this.Balance = balance;
            this.Holder.Accounts.Add(this); // automatically appends current account to the customer's list of accounts
        }
示例#2
0
        static void Main()
        {
            Bank MGM = new Bank();
            Customer pesho = new Customer(CustomerType.Individual, "Pesho Peshev");
            Customer telerik = new Customer(CustomerType.Company, "Telerik AD");

            Mortage mortageAccount = new Mortage(pesho, 10000M, 0.666M);
            Deposit depositAccount = new Deposit(telerik, 10000m, 0.066M);

            MGM.AddAccount(mortageAccount);
            MGM.AddAccount(depositAccount);
        }
 public Mortgage(Customer holder, decimal interest = 0.416m, decimal balance = 100.0m)
     : base(holder, interest, balance)
 {
 }
示例#4
0
 protected Account(Customer customer, decimal balance, decimal interestRate)
 {
     this.customer = customer;
     this.balance = balance;
     this.interestRate = interestRate;
 }
示例#5
0
 public Loan(Customer customer, decimal balance, decimal interestRate)
     : base(customer, balance, interestRate)
 {
 }
示例#6
0
 public LoanAccount(decimal interestPerMonth, decimal balance, Customer customer)
     : base(interestPerMonth, balance, customer)
 {
 }
示例#7
0
 public Deposit(Customer customer, decimal balance, decimal interestRate)
     : base(customer, balance, interestRate)
 {
 }
 public Deposit(Customer holder, decimal interest = 0.416m, decimal balance = 100.0m)
     : base(holder, interest, balance)
 {
 }
示例#9
0
 protected Account(decimal interestPerMonth, decimal balance, Customer customer)
 {
     this.InterestPerMonth = interestPerMonth;
     this.Balance = balance;
     this.Customer = customer;
 }
示例#10
0
文件: Bank.cs 项目: nexusstar/Telerik
 public void AddCustomer(Customer customer)
 {
     this.bankCustomers.Add(customer);
 }
示例#11
0
 public Mortage(Customer customer, decimal balance, decimal interestRate)
     : base(customer, balance, interestRate)
 {
 }