Ejemplo n.º 1
0
        public InterestBearingAccount(decimal initialDeposit, InterestCounpoundType compoundType = InterestCounpoundType.Daily) : base(initialDeposit)
        {
            MonetaryCycles = new CoreList <MonetaryCycle>();
            this._CreateCycle(DateProvider.Now().Date);

            RateLimits        = new List <IRateLimit>();
            this.CompoundType = compoundType;
            this.RegisterRateProviders();
            this.Transactions_OnAdd(this.Transactions[0], null);
        }
Ejemplo n.º 2
0
 public CheckingAccount(decimal initialDeposit, InterestCounpoundType compoundeType = InterestCounpoundType.Daily, double defaultRate = 0.0) : base(initialDeposit)
 {
     base.DefaultInterestRate = defaultRate;
     base.Type     = InterestAccountType.Checking;
     base.TypeName = "Checking Account";
 }
Ejemplo n.º 3
0
        public IInterestAccount OpenInterestAccount(InterestAccountType type, decimal initialDeposit, InterestCounpoundType compoundType = InterestCounpoundType.Daily, double defaultRate = 0.0)
        {
            ValidationHelper.NotNull(type, "type");
            ValidationHelper.NegativeNumeric <decimal>(initialDeposit, "initialDeposit");
            ValidationHelper.NegativeNumeric <double>(defaultRate, "defaultRate");

            IInterestAccount _account = null;

            switch (type)
            {
            case (InterestAccountType.Checking):
                _account = new CheckingAccount(initialDeposit, compoundType, defaultRate);
                break;

            case (InterestAccountType.Savings):
                _account = new SavingsAccount(initialDeposit, compoundType, defaultRate);
                break;

            case (InterestAccountType.MaxiSavings):
                _account = new MaxiSavingsAccount(initialDeposit, compoundType, defaultRate);
                break;

            default:
                throw new Exception("Account type is not yet supported");
            }

            this.InterestAccounts.Add(_account);
            return(_account);
        }
Ejemplo n.º 4
0
 public SavingsAccount(decimal initialDeposit, InterestCounpoundType compoundeType = InterestCounpoundType.Daily, double defaultRate = 0.0) : base(initialDeposit, compoundeType)
 {
     base.DefaultInterestRate = defaultRate;
     base.Type     = InterestAccountType.Savings;
     base.TypeName = "Savings Account";
 }
Ejemplo n.º 5
0
        public static decimal SimpleInterestCompounding(decimal principle, double annualRate, int periodCount, InterestCounpoundType compoundType)
        {
            ValidationHelper.NegativeNumeric <decimal>(principle, "principle");
            ValidationHelper.NegativeNumeric <double>(annualRate, "annualRate");
            ValidationHelper.NegativeNumeric <int>(periodCount, "periodCount");

            decimal calculated_value = 0;

            switch (compoundType)
            {
            case InterestCounpoundType.Daily:
                calculated_value = _InterestCompoundCalculation(principle, annualRate, periodCount, 365);
                break;
            }

            return(calculated_value);
        }