public override decimal CalculateInterest(int periodInMonths) { SimpleValidator.CheckNotPositive(periodInMonths, "Interest period"); int prefs = GetPreferencePeriod(); // no interest for the first months if (periodInMonths <= prefs) { return(0); } return(base.CalculateInterest(periodInMonths - prefs)); }
public override decimal CalculateInterest(int periodInMonths) { SimpleValidator.CheckNotPositive(periodInMonths, "Interest period"); if (this.Owner.GetType() == typeof(Individual)) { return(CalculateInterestForIndividuals(periodInMonths)); } else if (this.Owner.GetType() == typeof(Company)) { return(CalculateInterestForCompanies(periodInMonths)); } else { throw new NotImplementedException(); } }